@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #11120f;
  --panel: #191a16;
  --panel-2: #20211c;
  --border: #303129;
  --text: #f4f4ec;
  --muted: #a1a296;
  --accent: #c8f169;
  --accent-dark: #a9d84a;
  --danger: #ff8a8a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  height: 76px;
  padding: 0 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  color: #11120f;
  background: var(--accent);
  font-size: 19px;
}

.brand-muted {
  margin-left: -7px;
  color: var(--muted);
  font-weight: 500;
}

.back-link {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s;
}

.back-link:hover,
.footer a:hover {
  color: var(--accent);
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
}

.hero {
  padding: 58px 0 35px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid #39442b;
  border-radius: 30px;
  color: var(--accent);
  background: #1b2114;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.hero h1 {
  margin: 17px 0 9px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -2px;
}

.hero h1 span {
  color: var(--accent);
}

.hero > p {
  max-width: 550px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}

.upload-zone,
.settings-panel,
.info-card {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--panel);
}

.upload-zone {
  min-height: 380px;
  padding: 38px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.dragging,
.upload-zone:focus-visible {
  border-color: var(--accent);
  background: #20251a;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid #3a422d;
  border-radius: 20px;
  color: var(--accent);
  background: #22271b;
  font-size: 38px;
  line-height: 1;
}

.upload-zone h2 {
  margin: 21px 0 4px;
  font-size: 20px;
}

.upload-zone p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.upload-zone small {
  margin-top: 16px;
  color: #818276;
  font-size: 11px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #171910;
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-secondary {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings-panel {
  padding: 25px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 23px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.4px;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.file-count {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 20px;
  color: var(--accent);
  background: #282e1e;
  font-size: 10px;
  font-weight: 700;
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.field label span {
  color: var(--accent);
}

.field select {
  width: 100%;
  min-height: 45px;
  padding: 0 12px;
  outline: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel-2);
}

.field select:focus {
  border-color: var(--accent);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.convert-btn {
  width: 100%;
  min-height: 48px;
  font-size: 13px;
}

.status {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--accent);
}

.results-section {
  padding: 55px 0 35px;
}

.results-section > .section-heading {
  margin-bottom: 19px;
}

.results-section > .section-heading h2 {
  font-size: 22px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 37px 20px;
  border: 1px dashed #3a3b32;
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  color: var(--accent);
  font-size: 29px;
}

.empty-state p {
  margin: 5px 0 0;
  font-size: 12px;
}

.result-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.result-preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 12px;
  background-color: #22231e;
  background-image:
    linear-gradient(45deg, #2c2d26 25%, transparent 25%),
    linear-gradient(-45deg, #2c2d26 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2c2d26 75%),
    linear-gradient(-45deg, transparent 75%, #2c2d26 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.result-preview img {
  display: block;
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
}

.result-info {
  padding: 14px;
}

.result-info h3 {
  overflow-wrap: anywhere;
  margin: 0 0 5px;
  font-size: 12px;
}

.result-info p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.result-info .btn {
  width: 100%;
  min-height: 38px;
}

.info-card {
  margin: 15px 0 45px;
  padding: 26px;
}

.info-card h2 {
  margin: 0 0 13px;
  font-size: 17px;
}

.info-card ol {
  padding-left: 20px;
  color: #d4d4c9;
  font-size: 12px;
}

.info-card li {
  padding: 4px 0;
}

.info-card p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.footer {
  min-height: 70px;
  padding: 20px 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.footer a {
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 760px) {
  .topbar {
    height: 65px;
    padding: 0 5%;
  }

  .container {
    width: 92%;
  }

  .hero {
    padding: 43px 0 27px;
  }

  .hero h1 {
    letter-spacing: -1.3px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    min-height: 285px;
  }

  .settings-panel {
    padding: 20px;
  }

  .results-section {
    padding-top: 40px;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .result-preview {
    min-height: 125px;
  }

  .info-card {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 17px;
  }

  .brand-icon {
    width: 31px;
    height: 31px;
  }

  .section-heading h2 {
    font-size: 15px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}