:root {
  --ink: #15231e;
  --muted: #62706a;
  --paper: #f5f4ed;
  --line: #dbe0d9;
  --moss: #1a7f58;
  --leaf: #b7e651;
  --shadow: 0 24px 70px rgba(21, 35, 30, 0.11);
}

* { 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 12% 13%, rgba(183, 230, 81, 0.37), transparent 24rem),
    radial-gradient(circle at 85% 8%, rgba(255, 214, 107, 0.34), transparent 21rem),
    linear-gradient(140deg, #f7f7f1 0%, #eff4eb 55%, #f7f2e8 100%);
  font-family: "Manrope", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}

.page-shell {
  position: relative;
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 28px 0 34px;
}

.site-header,
.panel-heading,
.form-options,
.job-topline,
.job-content,
.source-strip,
footer {
  display: flex;
  align-items: center;
}

.site-header { justify-content: space-between; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.65px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px 12px 8px 12px;
  background: var(--ink);
  transform: rotate(-8deg);
}

.brand-mark span {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--leaf);
  transform: rotate(8deg) translateX(1px);
}

.status-chip,
.formats,
.job-status,
.eyebrow,
footer,
.source-strip span {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #176045;
  border: 1px solid rgba(26, 127, 88, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.status-chip i,
.job-status i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31b675;
  box-shadow: 0 0 0 3px rgba(49, 182, 117, 0.17);
}

.hero { max-width: 690px; padding: 84px 0 38px; }
.eyebrow { margin: 0 0 13px; color: var(--moss); font-weight: 500; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.055em; }

h1 {
  max-width: 650px;
  margin-bottom: 21px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(46px, 8vw, 83px);
  font-weight: 700;
  line-height: 0.96;
}

h1 em { color: var(--moss); font-weight: 600; }
.intro { max-width: 570px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }

.download-panel,
.job-card {
  border: 1px solid rgba(21, 35, 30, 0.08);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.download-panel { padding: 26px; }
.panel-heading { justify-content: space-between; margin-bottom: 19px; }
.panel-heading .eyebrow { margin-bottom: 5px; font-size: 10px; }
h2 { margin-bottom: 0; font-size: 25px; line-height: 1.15; }
.formats { color: var(--muted); font-size: 10px; }

.url-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 69px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfcf9;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.url-row:focus-within {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(26, 127, 88, 0.11);
}

.link-icon { color: var(--moss); font-size: 22px; font-weight: 700; transform: rotate(45deg); }
.url-row input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.url-row input::placeholder, .filename-field input::placeholder { color: #98a39d; }

#submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  min-width: 155px;
  min-height: 51px;
  padding: 0 20px;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: var(--moss);
  box-shadow: 0 8px 15px rgba(26, 127, 88, 0.19);
  font-size: 14px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#submit-button:hover:not(:disabled) { background: #116745; transform: translateY(-2px); box-shadow: 0 12px 20px rgba(26, 127, 88, 0.24); }
#submit-button:active:not(:disabled) { transform: translateY(0); }
#submit-button:disabled { cursor: wait; opacity: 0.67; }
#submit-button b { font-size: 21px; line-height: 1; }

.form-options { justify-content: space-between; gap: 16px; margin-top: 16px; }
.format-switch { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; }
.format-switch label { position: relative; }
.format-switch input { position: absolute; opacity: 0; pointer-events: none; }
.format-switch span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.format-switch input:checked + span { color: var(--moss); border-color: rgba(26, 127, 88, 0.22); background: #eff8ee; }
.format-switch input:focus-visible + span { outline: 2px solid var(--moss); outline-offset: 2px; }
.video-glyph { width: 13px; height: 9px; border: 2px solid currentColor; border-radius: 3px; }
.audio-glyph { font-size: 17px; line-height: 1; }

.filename-field { display: flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filename-field input { width: 155px; padding: 3px 0; border: 0; border-bottom: 1px solid var(--line); outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filename-field input:focus { border-bottom-color: var(--moss); }
.form-error { margin: 13px 0 0; color: #b84633; font-size: 12px; font-weight: 700; }

.job-card { position: relative; overflow: hidden; margin-top: 19px; padding: 18px 21px 20px; }
.job-card::after { position: absolute; right: -44px; bottom: -65px; width: 170px; height: 170px; border: 25px solid rgba(183, 230, 81, 0.15); border-radius: 50%; content: ""; }
.job-topline { position: relative; z-index: 1; justify-content: space-between; }
.job-status { display: inline-flex; align-items: center; gap: 9px; color: var(--moss); font-size: 10px; }
.dismiss { width: 28px; height: 28px; color: var(--muted); border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; transition: color 160ms ease, background 160ms ease; }
.dismiss:hover { color: var(--ink); background: #eef1eb; }

.job-content { position: relative; z-index: 1; gap: 14px; margin-top: 16px; }
.job-art { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; color: var(--moss); border-radius: 14px; background: #e6f4db; font-size: 26px; font-weight: 800; }
.job-details { min-width: 0; }
.job-details p { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.job-details h3 { overflow: hidden; margin-bottom: 5px; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.job-details small { color: #87928c; font-family: "DM Mono", monospace; font-size: 10px; }

.progress-track { position: relative; z-index: 1; height: 5px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: #e5eae3; }
.progress-track span { position: absolute; top: 0; bottom: 0; width: 36%; border-radius: inherit; background: linear-gradient(90deg, var(--moss), var(--leaf)); animation: progress-slide 1.4s ease-in-out infinite; }
@keyframes progress-slide { 0% { left: -36%; } 100% { left: 100%; } }

.file-download { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 19px; padding: 14px 16px; color: #14583f; border: 1px solid rgba(26, 127, 88, 0.3); border-radius: 11px; background: #eef9ea; font-size: 13px; font-weight: 800; text-decoration: none; transition: transform 160ms ease, background 160ms ease; }
.file-download:hover { background: #e2f5dc; transform: translateY(-1px); }
.file-download b { display: inline-block; margin-right: 7px; font-size: 19px; vertical-align: -2px; }
.file-download small { color: var(--moss); font-family: "DM Mono", monospace; font-size: 10px; }

.source-strip { justify-content: center; flex-wrap: wrap; gap: 13px 24px; margin: 38px auto 0; color: #829088; }
.source-strip span { color: var(--moss); font-size: 10px; }
.source-strip b { color: #65736c; font-size: 12px; letter-spacing: -0.02em; }
footer { justify-content: space-between; gap: 18px; margin-top: 56px; color: #849087; font-size: 9px; line-height: 1.55; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 620px) {
  .page-shell { width: min(100% - 28px, 920px); padding-top: 18px; }
  .hero { padding: 62px 0 32px; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .download-panel { padding: 19px; border-radius: 17px; }
  .url-row { flex-wrap: wrap; gap: 9px; padding: 13px; }
  .url-row input { width: calc(100% - 36px); flex: auto; }
  #submit-button { width: 100%; min-height: 48px; }
  .form-options { align-items: flex-start; flex-direction: column; }
  .filename-field { width: 100%; }
  .filename-field input { flex: 1; width: auto; }
  footer { align-items: flex-start; flex-direction: column; margin-top: 42px; }
}

@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; }
}
