@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #07142f;
  --muted: #647087;
  --blue: #1155f5;
  --blue-dark: #0646d8;
  --coral: #ff654d;
  --line: #dbe1eb;
  --soft: #f4f7fc;
  --white: #fff;
  --radius: 3px;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--white); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  height: 92px;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -2px;
}
.how-button {
  border: 0;
  background: transparent;
  padding: 8px 0;
  color: var(--blue);
  font-size: 16px;
  font-weight: 600;
}
.how-button:hover { color: var(--blue-dark); }

.workspace {
  min-height: 690px;
  overflow: hidden;
  position: relative;
  padding: 68px 24px 58px;
}
.workspace > *:not(.ribbon) { position: relative; z-index: 1; max-width: 1160px; margin-left: auto; margin-right: auto; }
.ribbon { position: absolute; z-index: 0; width: 420px; height: 32px; background: #edf3ff; transform: rotate(38deg); }
.ribbon::after { content: ""; position: absolute; left: 0; top: 54px; width: 100%; height: 14px; background: #f5f8ff; }
.ribbon-top { left: -210px; top: 88px; }
.ribbon-bottom { right: -210px; bottom: 30px; }

h1 {
  margin-top: 0;
  margin-bottom: 62px;
  max-width: 860px;
  font-size: clamp(46px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -.055em;
  text-align: center;
}
.url-form label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 16px;
}
.url-controls { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 12px; }
.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round;
}
input {
  width: 100%;
  height: 64px;
  border: 2px solid #aeb8c9;
  border-radius: var(--radius);
  background: var(--white);
  padding: 0 56px;
  color: var(--ink);
  font-size: 17px;
  outline: none;
  transition: border .18s, box-shadow .18s;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,85,245,.12); }
input::placeholder { color: #98a2b4; }
.clear-button {
  display: none;
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted);
}
.clear-button.visible { display: grid; place-items: center; }
.clear-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.primary-button {
  min-height: 56px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  transition: background .18s, transform .18s;
}
.primary-button:hover { background: var(--blue-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible, .how-button:focus-visible, .clear-button:focus-visible { outline: 3px solid rgba(17,85,245,.28); outline-offset: 2px; }
.primary-button:disabled { cursor: not-allowed; background: #91abeb; }
.analyze-button { height: 64px; font-size: 16px; }
.button-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.analyze-button.loading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.analyze-button.loading .button-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.field-message { min-height: 24px; margin-top: 8px; margin-bottom: 0; color: #c53524; font-size: 14px; }

.result {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 34px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 24px;
  box-shadow: 0 18px 50px rgba(7,20,47,.07);
}
.result[hidden] { display: none; }
.result-media { position: relative; min-height: 205px; overflow: hidden; background: var(--soft); }
.result-media img { display: block; width: 100%; height: 100%; min-height: 205px; max-height: 230px; object-fit: cover; }
.duration { position: absolute; right: 12px; bottom: 12px; padding: 5px 8px; background: rgba(7,20,47,.9); color: white; font-size: 13px; font-weight: 700; }
.coral-line { position: absolute; left: 0; bottom: 0; width: 38%; height: 5px; background: var(--coral); }
.found-label { margin: 0 0 7px; color: var(--coral); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.result h2 { margin: 0 0 7px; font-size: clamp(21px, 2.2vw, 28px); line-height: 1.25; letter-spacing: -.025em; }
.metadata { margin: 0; color: var(--muted); font-size: 14px; }
.dot { margin: 0 9px; }
.divider { height: 1px; margin: 23px 0 20px; background: var(--line); }
.download-controls { display: grid; grid-template-columns: 1fr 1fr 180px; gap: 14px; align-items: end; }
.download-controls label { margin: 0; }
.download-controls label > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
select {
  width: 100%; height: 54px; border: 1px solid #aeb8c9; border-radius: var(--radius);
  padding: 0 38px 0 14px; background: var(--white); color: var(--ink); outline: none;
}
select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,85,245,.1); }
.download-button { height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; }
.download-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.progress-area { margin-top: 20px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; background: #e6ebf3; }
.progress-value { width: 0; height: 100%; background: var(--coral); transition: width .3s ease; }

.empty-guide {
  display: grid;
  grid-template-columns: 42px 1fr 42px 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 46px;
  color: var(--muted);
}
.guide-number { color: var(--coral); font-size: 13px; font-weight: 800; letter-spacing: .08em; padding-top: 3px; }
.empty-guide p { margin: 0; max-width: 380px; font-size: 14px; line-height: 1.6; }

.help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 7vw, 110px);
  padding: 52px max(24px, calc((100vw - 1160px) / 2));
  background: var(--ink);
  color: white;
}
.help > div { display: flex; gap: 18px; }
.help svg { flex: 0 0 30px; width: 30px; height: 30px; fill: none; stroke: #86a7ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.help svg.coral { stroke: var(--coral); }
.help p { margin: 0; color: #aab5c9; font-size: 14px; line-height: 1.7; }
.help strong { color: white; font-size: 15px; }
footer {
  min-height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px max(24px, calc((100vw - 1160px) / 2));
  color: var(--muted); font-size: 12px;
}

@media (max-width: 860px) {
  .result { grid-template-columns: 260px 1fr; gap: 22px; }
  .download-controls { grid-template-columns: 1fr 1fr; }
  .download-button { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .site-header { height: 72px; padding: 0 20px; }
  .logo { font-size: 29px; }
  .how-button { font-size: 14px; }
  .workspace { min-height: 0; padding: 48px 18px; }
  h1 { text-align: left; font-size: 48px; }
  h1 { margin-bottom: 56px; }
  .url-controls { grid-template-columns: 1fr; }
  input { height: 58px; font-size: 15px; padding-left: 48px; }
  .input-wrap > svg { left: 16px; }
  .analyze-button { height: 56px; }
  .result { grid-template-columns: 1fr; padding: 14px; gap: 20px; }
  .result-media img { max-height: none; aspect-ratio: 16/9; min-height: 0; }
  .result-content { padding: 0 4px 5px; }
  .download-controls { grid-template-columns: 1fr; }
  .download-button { grid-column: auto; }
  .empty-guide { grid-template-columns: 34px 1fr; margin-top: 35px; }
  .help { grid-template-columns: 1fr; padding: 38px 22px; }
  footer { align-items: flex-start; flex-direction: column; padding: 28px 22px; }
}

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