@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Mono:wght@300;400;500&display=swap");

:root {
  color-scheme: dark;
  --ink: #10100f;
  --paper: #f0eee7;
  --muted: #a8a69f;
  --line: #3a3935;
  --acid: #dbff3f;
  --error: #ff6b51;
  --display: "Archivo Black", Impact, sans-serif;
  --mono: "DM Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 74% 18%, rgba(219, 255, 63, 0.06), transparent 26rem),
    var(--ink);
  font-family: var(--mono);
}

.noise {
  position: fixed;
  z-index: 10;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.updater {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 24px;
  max-width: 940px;
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #151513;
}

.updater .eyebrow,
.updater-version,
.updater-message {
  margin: 0;
}

.updater-version {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.updater-version strong {
  color: var(--paper);
  font-weight: 500;
}

.updater-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.updater-controls label {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.updater select,
.updater button {
  height: 36px;
  border: 1px solid #5b5a54;
  color: var(--paper);
  background: var(--ink);
  font-size: 10px;
  text-transform: uppercase;
}

.updater select {
  padding: 0 28px 0 10px;
}

.updater button {
  padding: 0 14px;
}

.updater-message {
  min-height: 14px;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

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

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 21px;
  height: 14px;
  background: var(--acid);
  clip-path: polygon(0 0, 100% 0, 72% 50%, 100% 100%, 0 100%, 28% 50%);
}

.health {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f3bd42;
  box-shadow: 0 0 9px currentColor;
}

.health.ready .health-dot {
  background: var(--acid);
}

.health.error .health-dot {
  background: var(--error);
}

.hero {
  position: relative;
  padding: 105px 0 110px;
}

.hero::after {
  position: absolute;
  top: 78px;
  right: 3%;
  width: clamp(100px, 15vw, 190px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  background:
    linear-gradient(45deg, transparent 49.5%, var(--line) 49.5%, var(--line) 50.5%, transparent 50.5%),
    linear-gradient(-45deg, transparent 49.5%, var(--line) 49.5%, var(--line) 50.5%, transparent 50.5%);
}

.eyebrow,
.section-number,
legend,
.notice-index,
footer {
  color: var(--acid);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 20px 0 30px;
  font-family: var(--display);
  font-size: clamp(60px, 9.8vw, 138px);
  line-height: 0.82;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

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

.intro {
  max-width: 620px;
  margin-bottom: 58px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
}

.lookup {
  max-width: 940px;
}

.lookup label {
  display: block;
  margin-bottom: 10px;
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  border: 1px solid #5b5a54;
  background: #171715;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-row:focus-within {
  border-color: var(--acid);
  box-shadow: 0 0 0 1px var(--acid);
}

.input-row input {
  min-width: 0;
  height: 68px;
  padding: 0 22px;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 14px;
}

.input-row input::placeholder {
  color: #62615c;
}

.primary-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  border: 0;
  color: var(--ink);
  background: var(--acid);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.primary-button:not(:disabled):hover .primary-button span:last-child {
  transform: translateX(4px);
}

.primary-button span:last-child {
  font-size: 22px;
  transition: transform 160ms ease;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--error);
  font-size: 12px;
}

.video-card {
  display: grid;
  grid-template-columns: 44% 56%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #151513;
}

.video-card[hidden],
.downloads-section[hidden],
fieldset[hidden] {
  display: none;
}

.thumbnail-wrap {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #242420;
}

.thumbnail-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 65%, rgba(16, 16, 15, 0.75));
}

.thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.06);
}

.duration {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--acid);
  font-size: 11px;
  font-weight: 500;
}

.video-content {
  padding: clamp(36px, 5vw, 72px);
  border-left: 1px solid var(--line);
}

.video-content h2 {
  margin: 20px 0 12px;
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.channel {
  margin-bottom: 45px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

legend {
  margin-bottom: 13px;
  color: var(--muted);
}

.quality-grid,
.format-grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.quality-grid {
  grid-template-columns: repeat(4, 1fr);
}

.format-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 22px;
}

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

.quality-option input {
  position: absolute;
  opacity: 0;
}

.quality-option span {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: color 150ms ease, background 150ms ease;
}

.quality-option strong {
  font-family: var(--display);
  font-size: 21px;
}

.quality-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.quality-option input:checked + span {
  color: var(--ink);
  background: var(--acid);
}

.quality-option input:checked + span small {
  color: #434b15;
}

.quality-option input:focus-visible + span {
  outline: 2px solid var(--paper);
  outline-offset: -3px;
}

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

.format-option input {
  position: absolute;
  opacity: 0;
}

.format-option span {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: color 150ms ease, background 150ms ease;
}

.format-option strong {
  font-family: var(--display);
  font-size: 21px;
}

.format-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.format-option input:checked + span {
  color: var(--ink);
  background: var(--acid);
}

.format-option input:checked + span small {
  color: #434b15;
}

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

.download-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  border: 1px solid var(--paper);
  color: var(--paper);
  background: transparent;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: color 160ms ease, background 160ms ease;
}

.download-button:not(:disabled):hover {
  color: var(--ink);
  background: var(--paper);
}

.download-icon {
  font-size: 24px;
}

.downloads-section {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.downloads-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: clamp(36px, 6vw, 70px) clamp(24px, 6vw, 80px) 32px;
}

.downloads-heading .section-number {
  color: #6b6a64;
}

.downloads-heading h2 {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 64px);
  letter-spacing: -0.05em;
}

.clear-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #77766f;
  color: var(--ink);
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.downloads-list {
  border-top: 1px solid #c8c6bf;
}

.download-item {
  padding: 18px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid #c8c6bf;
}

.download-item:last-child {
  border-bottom: 0;
}

.download-summary {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 150px 64px;
  align-items: center;
  gap: 14px;
}

.download-meta {
  display: flex;
  gap: 8px;
}

.download-meta span {
  padding: 5px 8px;
  border: 1px solid #aaa8a1;
  color: #5b5a54;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.download-item h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-status {
  margin: 0;
  color: #65645e;
  font-size: 11px;
  text-transform: uppercase;
}

.download-progress-value {
  text-align: right;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.progress-track {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  background: #d2d0c9;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 250ms ease;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: #65645e;
  font-size: 9px;
  text-transform: uppercase;
}

.result {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.result.error {
  color: #bc2f19;
}

.file-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-link[hidden] {
  display: none;
}

.notice {
  display: grid;
  grid-template-columns: 140px minmax(0, 620px);
  gap: 30px;
  padding: 62px 0 90px;
}

.notice-index {
  color: var(--muted);
}

.notice p {
  color: #77766f;
  font-size: 11px;
  line-height: 1.8;
  text-transform: uppercase;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 0 35px;
  border-top: 1px solid var(--line);
  color: #66655f;
  font-size: 9px;
}

@media (max-width: 800px) {
  .site-header,
  main,
  footer {
    width: min(100% - 30px, 680px);
  }

  .hero {
    padding: 72px 0 78px;
  }

  .hero::after {
    top: 50px;
    opacity: 0.55;
  }

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

  .thumbnail-wrap {
    min-height: auto;
    aspect-ratio: 16 / 9;
  }

  .video-content {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .download-summary {
    grid-template-columns: 130px minmax(0, 1fr) 58px;
  }

  .download-status {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 70px;
  }

  .health span:last-child {
    display: none;
  }

  .hero {
    padding-top: 58px;
  }

  h1 {
    font-size: clamp(48px, 17vw, 78px);
  }

  .intro {
    margin-bottom: 38px;
    font-size: 13px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row input {
    height: 62px;
  }

  .primary-button {
    min-height: 56px;
  }

  .quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .updater-controls {
    flex-wrap: wrap;
  }

  .downloads-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-summary {
    grid-template-columns: minmax(0, 1fr) 50px;
  }

  .download-meta {
    grid-column: 1 / -1;
  }

  .download-progress-value {
    grid-column: 2;
    grid-row: 2;
  }

  .progress-track {
    margin-top: 11px;
  }

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

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

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