:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #121419;
  --surface-strong: #171a20;
  --line: #282c35;
  --line-soft: rgba(255, 255, 255, 0.075);
  --text: #f5f6f8;
  --muted: #8c929e;
  --orange: #ff6b00;
  --orange-light: #ff9141;
  --cyan: #27d6df;
  --danger: #ff5c6c;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: -22rem;
  right: -12rem;
  background: var(--orange);
}

.ambient-two {
  bottom: -29rem;
  left: -19rem;
  background: var(--cyan);
}

.topbar,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.brand-by {
  color: #9ba0a9;
}

.brand-salty {
  color: var(--orange);
}

.brand-product {
  margin-left: 12px;
  color: #696f7a;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.service-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(39, 214, 223, 0.8);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 68px;
  padding-block: 86px 64px;
}

.intro {
  align-self: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  font-size: clamp(3.5rem, 7vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
}

h1 span {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--orange);
}

.lead {
  max-width: 500px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.grabber-card,
.job-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(24, 27, 33, 0.97), rgba(16, 18, 23, 0.97));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.grabber-card::before,
.job-card::before {
  position: absolute;
  inset: -1px auto auto 28px;
  width: 72px;
  height: 2px;
  content: "";
  background: var(--orange);
  box-shadow: 0 0 22px rgba(255, 107, 0, 0.55);
}

.grabber-card {
  padding: 32px;
}

.field-label,
legend {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  color: #c8cbd2;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.url-row {
  display: flex;
  overflow: hidden;
  border: 1px solid #343945;
  border-radius: 14px;
  background: #0e1014;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.url-row:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12);
}

#youtube-url {
  min-width: 0;
  flex: 1;
  padding: 17px 18px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.92rem;
}

#youtube-url::placeholder {
  color: #565c67;
}

.paste-button {
  margin: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #b5bac3;
  background: #20232a;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.paste-button:hover {
  color: #fff;
  background: #2b2f38;
}

fieldset {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}

.format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.format-option {
  position: relative;
  cursor: pointer;
}

.format-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.format-content {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid #30343e;
  border-radius: 14px;
  color: #7f8590;
  background: rgba(10, 11, 14, 0.45);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.format-option:hover .format-content {
  transform: translateY(-1px);
  border-color: #484e5a;
}

.format-option input:focus-visible + .format-content {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.format-option input:checked + .format-content {
  border-color: var(--orange);
  color: #bfc3ca;
  background: rgba(255, 107, 0, 0.075);
}

.format-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.format-top strong {
  color: var(--text);
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.format-badge {
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--muted);
  background: #252932;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.submit-button,
.download-button {
  display: flex;
  width: 100%;
  min-height: 57px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  color: #111;
  background: var(--orange);
  box-shadow: 0 12px 28px rgba(255, 107, 0, 0.18);
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover,
.download-button:hover {
  transform: translateY(-1px);
  background: var(--orange-light);
  box-shadow: 0 15px 34px rgba(255, 107, 0, 0.25);
}

.submit-button:disabled {
  transform: none;
  opacity: 0.55;
  cursor: wait;
}

.form-error,
.job-error {
  margin: 16px 0 0;
  color: #ff9da6;
  font-size: 0.86rem;
  line-height: 1.5;
}

.job-card {
  grid-column: 2;
  padding: 28px 32px;
}

.job-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.job-state {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.job-heading h2 {
  max-width: 620px;
  margin: 0;
  overflow: hidden;
  font-size: 1.15rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-percent {
  color: var(--orange);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.progress-track {
  height: 8px;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: #090a0d;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ff9d55);
  box-shadow: 0 0 16px rgba(255, 107, 0, 0.5);
  transition: width 320ms ease;
}

.job-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.job-meta span:last-child {
  text-align: right;
}

.new-download-button {
  display: block;
  margin: 16px auto 0;
  padding: 8px 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
}

.new-download-button:hover {
  color: var(--text);
}

.stats {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 38px;
  align-items: end;
  margin-top: 28px;
  padding-top: 38px;
  border-top: 1px solid var(--line-soft);
}

.stats-heading .eyebrow {
  margin-bottom: 10px;
}

.stats-heading h2 {
  max-width: 320px;
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 18, 23, 0.82);
}

.stat-card {
  display: flex;
  min-width: 0;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.stat-card + .stat-card {
  border-left: 1px solid var(--line-soft);
}

.stat-card-highlight {
  background: linear-gradient(145deg, rgba(255, 107, 0, 0.16), rgba(255, 107, 0, 0.035));
}

.stat-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.75rem, 3.3vw, 2.65rem);
  line-height: 1;
  letter-spacing: -0.06em;
  text-overflow: ellipsis;
}

.stat-card-highlight strong {
  color: var(--orange);
}

.stat-card small {
  color: var(--muted);
  font-size: 0.72rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 25px 34px;
  border-top: 1px solid var(--line-soft);
  color: #666c77;
  font-size: 0.7rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 58px;
  }

  .intro {
    max-width: 650px;
  }

  h1 {
    font-size: clamp(3.8rem, 15vw, 6rem);
  }

  .job-card {
    grid-column: 1;
  }

  .stats {
    grid-column: 1;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .stats-heading h2 {
    max-width: 520px;
  }
}

@media (max-width: 620px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1120px);
  }

  .topbar {
    min-height: 76px;
  }

  .brand-product,
  .service-state {
    display: none;
  }

  main {
    padding-block: 44px 42px;
  }

  h1 {
    font-size: clamp(3.25rem, 18vw, 4.8rem);
  }

  .lead {
    margin-top: 22px;
    font-size: 0.94rem;
  }

  .grabber-card,
  .job-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .format-grid {
    grid-template-columns: 1fr;
  }

  .format-content {
    min-height: 88px;
  }

  .job-heading h2 {
    max-width: 68vw;
  }

  .job-meta {
    flex-direction: column;
    gap: 6px;
  }

  .job-meta span:last-child {
    text-align: left;
  }

  .stats {
    gap: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 124px;
  }

  .stat-card + .stat-card {
    border-left: 0;
  }

  .stat-card:nth-child(even) {
    border-left: 1px solid var(--line-soft);
  }

  .stat-card:nth-child(n + 3) {
    border-top: 1px solid var(--line-soft);
  }

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

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