:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #66645f;
  --paper: #f7f5f1;
  --panel: #ffffff;
  --line: #dedbd3;
  --line-strong: #1b1b1b;
  --green: #0b6f48;
  --orange: #d96223;
  --danger: #ad3f32;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

a {
  color: inherit;
  overflow-wrap: anywhere;
  text-underline-offset: 0.22em;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

.home-shell {
  width: min(100vw - 28px, 1120px);
  min-height: calc(100vh - 58px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  padding: 24px 0 18px;
}

.home-copy,
.info-shell {
  min-width: 0;
}

.brand-mark {
  display: inline-block;
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-link:hover,
.brand-link:focus-visible {
  color: var(--muted);
}

.home-copy .brand-mark {
  margin-top: 4px;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 16vw, 5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: 0;
}

p {
  line-height: 1.5;
}

.lead {
  max-width: 540px;
  margin: 20px 0 0;
  color: #282722;
  font-size: 1.02rem;
}

.lead.compact {
  margin-top: 14px;
  font-size: 0.98rem;
}

.meta-line {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-surface,
.watch-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.upload-surface {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.surface-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  padding-right: 36px;
  color: #2f2e2a;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero-media {
  position: relative;
  z-index: 1;
  height: clamp(230px, 62vw, 360px);
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #111111;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111111;
}

.mobile-hero-copy {
  display: none;
}

.upload-form,
.export-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.drop-zone {
  min-height: auto;
  display: grid;
  place-items: end start;
  align-content: end;
  gap: 9px;
  padding: 4px 0 8px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(0deg, transparent calc(100% - 2px), var(--line-strong) calc(100% - 2px)),
    linear-gradient(90deg, var(--line-strong), var(--line-strong)) left bottom / 100% 2px no-repeat,
    transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.drop-zone.is-dragging {
  color: var(--ink);
}

.drop-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
}

.drop-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2rem, 11vw, 3.15rem);
  font-weight: 500;
  line-height: 0.94;
}

.drop-copy {
  max-width: 250px;
  font-size: 0.92rem;
}

.file-preview {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.file-preview video {
  width: 92px;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  border-radius: 14px;
  background: #111111;
}

.file-preview strong,
.file-preview span {
  display: block;
}

.file-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-action,
.secondary-action,
.secondary-link {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.secondary-action,
.secondary-link {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.result {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.result-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.result-header strong,
.result-header span {
  display: block;
}

.result-header strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.result-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.share-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.share-box a {
  font-size: 0.9rem;
  font-weight: 700;
}

.success-dot,
.loader {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.success-dot {
  background: var(--green);
}

.loader {
  display: inline-block;
  border: 3px solid rgba(17, 17, 17, 0.16);
  border-top-color: var(--ink);
  animation: spin 850ms linear infinite;
}

.loader.small {
  border-color: rgba(17, 17, 17, 0.16);
  border-top-color: var(--ink);
}

.watch {
  width: min(100vw - 20px, 1180px);
  min-height: calc(100vh - 20px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
}

.player {
  position: relative;
  min-height: 46vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #111111;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

video {
  width: 100%;
  max-height: 76vh;
  background: #111111;
}

.processing-preview {
  position: relative;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 46vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), transparent 42%),
    #111111;
}

.processing-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.74)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.56), transparent 58%);
  pointer-events: none;
}

.source-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 260ms ease;
}

.processing-preview.has-source-preview .source-preview-video {
  opacity: 1;
}

.processing-overlay {
  position: relative;
  z-index: 1;
  width: min(470px, calc(100% - 32px));
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 22px 0;
  color: #ffffff;
}

.processing-overlay h2,
.processing-overlay p {
  margin: 0;
}

.processing-overlay h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 10vw, 3.65rem);
  font-weight: 500;
  line-height: 0.94;
}

.processing-overlay p {
  max-width: 360px;
  color: rgba(255, 255, 255, 0.74);
}

.processing-overlay .secondary-action {
  border-color: rgba(255, 255, 255, 0.72);
  color: #ffffff;
}

.processing-overlay .loader {
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
}

.thumbnail-strip {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.thumbnail-button {
  min-width: 0;
  height: clamp(48px, 13vw, 74px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.thumbnail-button.is-active {
  border-color: #ffffff;
}

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

.watch-panel {
  padding: 20px 18px;
}

.watch-panel h1 {
  font-size: clamp(2rem, 12vw, 3.25rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 20px 0 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--ink);
}

.drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.export-form {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
}

.exports {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.export-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.export-row a {
  grid-column: 1 / -1;
}

.panel-note,
.product-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.panel-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.product-note {
  width: min(100vw - 28px, 1120px);
  margin: 0 auto;
  padding: 0 0 24px;
}

.info-shell {
  width: min(100vw - 28px, 980px);
  margin: 0 auto;
  padding: clamp(30px, 8vw, 76px) 0;
}

.info-shell h1 {
  max-width: 850px;
  font-size: clamp(2.75rem, 12vw, 5rem);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 42px;
}

.info-grid > div {
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
}

.info-grid p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 700px) {
  .home-shell {
    width: min(100vw - 56px, 1120px);
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 430px);
    gap: clamp(34px, 6vw, 84px);
    align-items: center;
    padding-top: clamp(40px, 7vw, 78px);
  }

  .home-copy {
    padding-bottom: 46px;
  }

  h1 {
    font-size: clamp(4rem, 7.6vw, 6.8rem);
  }

  .lead {
    font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  }

  .upload-surface {
    padding: 22px;
    border-radius: 28px;
  }

  .hero-media {
    height: 390px;
    border-radius: 22px;
  }

  .product-note {
    width: min(100vw - 56px, 1120px);
  }

  .watch {
    width: min(100vw - 48px, 1180px);
    min-height: calc(100vh - 48px);
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.64fr);
    gap: 18px;
    align-items: center;
    padding: 24px 0;
  }

  .player {
    min-height: min(78vh, 780px);
    border-radius: 28px;
  }

  .watch-panel {
    border-radius: 28px;
    padding: 24px;
  }

  .share-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .export-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .export-row a {
    grid-column: auto;
  }

  .info-shell {
    width: min(100vw - 56px, 980px);
  }

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

@media (min-width: 1020px) {
  .info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .home-shell,
  .product-note,
  .info-shell {
    width: min(100vw - 20px, 420px);
  }

  .upload-surface,
  .watch-panel,
  .player {
    border-radius: 18px;
  }

  .hero-media {
    height: 225px;
  }
}

@media (max-width: 699px) {
  body.home-page {
    background: #111111;
  }

  .home-page .home-shell {
    width: 100vw;
    min-height: 100svh;
    gap: 0;
    padding: 0;
  }

  .home-page .home-copy {
    display: none;
  }

  .home-page .upload-surface {
    min-height: 100svh;
    display: grid;
    align-content: stretch;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: #111111;
    box-shadow: none;
  }

  .home-page .hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .home-page .hero-media::after {
    inset: 0;
    height: auto;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 28%),
      linear-gradient(180deg, transparent 34%, rgba(0, 0, 0, 0.18) 52%, rgba(0, 0, 0, 0.82) 100%);
  }

  .home-page .surface-topline {
    color: rgba(255, 255, 255, 0.88);
  }

  .home-page .mobile-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    align-self: end;
    gap: 12px;
    margin-top: auto;
    padding: 34svh 0 12px;
    color: #ffffff;
  }

  .home-page .mobile-hero-copy .brand-mark,
  .home-page .mobile-hero-copy h2,
  .home-page .mobile-hero-copy p {
    margin: 0;
  }

  .home-page .mobile-hero-copy .brand-mark {
    color: #ffffff;
    font-size: 1.18rem;
  }

  .home-page .mobile-hero-copy h2 {
    max-width: 9ch;
    font-size: clamp(3.3rem, 16vw, 4.8rem);
    line-height: 0.88;
  }

  .home-page .mobile-hero-copy p {
    max-width: 300px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.98rem;
  }

  .home-page .upload-form {
    align-self: end;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .home-page .drop-zone {
    color: rgba(255, 255, 255, 0.78);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)) left bottom / 100% 1px no-repeat;
  }

  .home-page .drop-icon {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
  }

  .home-page .drop-title {
    color: #ffffff;
    font-size: clamp(2.15rem, 12vw, 3.1rem);
  }

  .home-page .primary-action {
    border-color: #ffffff;
    background: #ffffff;
    color: #111111;
  }

  .home-page .file-preview,
  .home-page .result {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
  }

  .home-page .file-preview strong,
  .home-page .result-header strong {
    color: #ffffff;
  }

  .home-page .file-preview span,
  .home-page .result-header span,
  .home-page .result .meta-line,
  .home-page .share-box a {
    color: rgba(255, 255, 255, 0.78);
  }

  .home-page .share-box {
    border-color: rgba(255, 255, 255, 0.28);
  }

  .home-page .share-box .secondary-action {
    border-color: rgba(255, 255, 255, 0.9);
    color: #ffffff;
  }

  .home-page .product-note {
    width: 100vw;
    margin: 0;
    padding: 14px 18px 20px;
    background: #111111;
    color: rgba(255, 255, 255, 0.72);
  }

  .home-page .product-note a {
    color: #ffffff;
  }
}
