:root {
  color-scheme: light;
  --ink: #171513;
  --muted: #77716a;
  --line: #ded9d2;
  --paper: #f4f1eb;
  --card: #fffefa;
  --red: #eb3d34;
  --red-dark: #c52620;
  --shadow: 0 24px 70px rgba(48, 39, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% 0%, rgba(235, 61, 52, 0.08), transparent 30rem), var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

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

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

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: Georgia, serif;
  font-style: italic;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a9d62;
  box-shadow: 0 0 0 5px rgba(42, 157, 98, 0.1);
}

.hero {
  padding: 100px 0 92px;
}

.eyebrow,
.result-kicker {
  margin: 0 0 20px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(48px, 7vw, 91px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--red);
  font-weight: inherit;
}

.hero-copy {
  max-width: 570px;
  margin: 30px 0 46px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.resolve-form {
  max-width: 850px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 254, 250, 0.78);
  box-shadow: var(--shadow);
}

.resolve-form > label,
.download-controls label {
  display: block;
  margin: 10px 12px 9px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 20px 86px 20px 20px;
  border: 0;
  border-radius: 14px;
  outline: 1px solid transparent;
  background: #f0ece5;
  color: var(--ink);
  line-height: 1.65;
  transition: outline-color 160ms ease;
}

textarea:focus {
  outline-color: var(--red);
}

textarea::placeholder {
  color: #9a938a;
}

.paste-button {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 2px 1px 12px;
}

.form-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-message.error {
  color: var(--red-dark);
}

.primary-button,
.download-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.primary-button:hover,
.download-button:hover {
  transform: translateY(-1px);
  background: var(--red-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-icon {
  font-size: 20px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
  overflow: hidden;
  margin-bottom: 110px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.result-card[hidden] {
  display: none;
}

.cover-wrap {
  position: relative;
  min-height: 410px;
  background: #292522;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.duration {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(23, 21, 19, 0.8);
  color: white;
  font-size: 12px;
}

.result-content {
  padding: clamp(28px, 5vw, 64px);
}

.result-content h2 {
  margin: 0 0 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.16;
}

.author {
  margin: 0;
  color: var(--muted);
}

.video-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 38px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  overflow: hidden;
}

.video-meta div {
  padding: 17px;
  background: var(--card);
}

.video-meta dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.video-meta dd {
  margin: 0;
  font-weight: 750;
}

.download-controls {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 10px;
}

.download-controls label {
  grid-column: 1 / -1;
  margin: 0;
}

select {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

.how-it-works {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 80px;
  padding: 88px 0;
  border-top: 1px solid var(--line);
}

.how-it-works h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
}

.how-it-works ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-it-works li {
  display: grid;
  grid-template-columns: 52px minmax(130px, 0.7fr) 1fr;
  gap: 22px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.how-it-works li:first-child {
  border-top: 1px solid var(--line);
}

.how-it-works li span {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.how-it-works li small {
  color: var(--muted);
  line-height: 1.6;
}

footer {
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    min-height: 72px;
  }

  .hero {
    padding: 68px 0 70px;
  }

  .hero-copy {
    margin-bottom: 32px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding-left: 2px;
  }

  .primary-button {
    width: 100%;
  }

  .result-card {
    grid-template-columns: 1fr;
    margin-bottom: 72px;
  }

  .cover-wrap {
    min-height: 300px;
    max-height: 480px;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 66px 0;
  }

  .how-it-works li {
    grid-template-columns: 40px 1fr;
  }

  .how-it-works li small {
    grid-column: 2;
  }
}

@media (max-width: 440px) {
  .status-pill {
    display: none;
  }

  .video-meta {
    grid-template-columns: 1fr;
  }

  .download-controls {
    grid-template-columns: 1fr;
  }
}

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