:root {
  --paper: #f4eee6;
  --card: #fbfaf7;
  --upload: #ece4d7;
  --ink: #100b08;
  --text: #554943;
  --muted: #82746b;
  --line: #ded2c3;
  --button: #a9a19b;
  --button-dark: #8d8580;
  --blue: #0a5f86;
  --red: #cc343e;
  --green: #15904b;
  --orange: #d97800;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.page-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.hero {
  max-width: 760px;
  margin-bottom: 62px;
}

.eyebrow,
.section-label,
.results-heading span,
.caption-card header span {
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 24px;
  color: #4d5361;
  font-size: 0.9rem;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.2rem, 8vw, 6.2rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.hero h1 em {
  color: #776c64;
  font-style: italic;
  font-weight: 400;
}

.intro {
  max-width: 760px;
  margin: 34px 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  line-height: 1.45;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.03fr) minmax(320px, 0.98fr);
  gap: 38px;
  align-items: stretch;
}

.upload-card,
.reader-card,
.caption-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(251, 250, 247, 0.64);
}

.upload-card {
  border-style: dashed;
  padding: 30px;
}

.reader-card {
  min-height: 448px;
  padding: 36px 30px;
}

.reader-card h2,
.results-heading h2,
.reader-card h2 {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.steps {
  display: grid;
  gap: 18px;
  margin: 26px 0 0;
  padding: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.45;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0;
}

.steps span {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.hidden-input {
  display: none;
}

.drop-zone {
  min-height: 316px;
  border-radius: 14px;
  background: var(--upload);
  overflow: hidden;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  box-shadow: inset 0 0 0 2px rgba(16, 11, 8, 0.12);
}

.drop-zone:focus-visible {
  outline: 3px solid rgba(16, 11, 8, 0.18);
  outline-offset: 4px;
}

.empty-upload {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 316px;
  padding: 32px;
  text-align: center;
}

.empty-upload strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.78rem;
  font-weight: 400;
  letter-spacing: -0.06em;
}

.empty-upload span {
  margin-top: 18px;
  color: var(--text);
  font-size: 1rem;
}

.drop-zone video {
  display: block;
  width: 100%;
  min-height: 316px;
  max-height: 360px;
  background: #050505;
  object-fit: contain;
}

.drop-zone.has-video {
  background: #050505;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.primary-button {
  min-width: 192px;
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  background: var(--button);
  color: #fff;
  padding: 0 24px;
  font-weight: 800;
}

.primary-button:hover:not(:disabled) {
  background: var(--button-dark);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.video-name {
  margin-left: auto;
  color: var(--text);
  overflow-wrap: anywhere;
}

.status-text {
  margin: 18px 0 0;
  color: var(--text);
  font-size: 1rem;
}

.status-text::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: middle;
}

.status-text.is-error {
  color: var(--red);
}

.sample-block {
  margin-top: 34px;
}

.section-label {
  margin: 0 0 16px;
  color: #655b56;
  font-size: 0.88rem;
}

.frame-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.frame-tile {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}

.frame-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.frame-tile figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  padding: 3px 7px;
  font-size: 0.72rem;
}

.results-section {
  margin-top: 118px;
  border-top: 1px solid var(--line);
  padding-top: 34px;
}

.results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
}

.results-heading h2 {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  letter-spacing: -0.08em;
}

.results-heading span {
  color: #564844;
  font-size: 0.92rem;
}

.caption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.caption-card {
  position: relative;
  min-height: 238px;
  padding: 36px 30px 30px;
  overflow: hidden;
}

.caption-card::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: var(--blue);
}

.sarcastic-card::before {
  background: var(--red);
}

.tech-card::before {
  background: var(--green);
}

.everyday-card::before {
  background: var(--orange);
}

.caption-card header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.caption-card header span {
  color: var(--blue);
  font-size: 0.88rem;
}

.sarcastic-card header span {
  color: var(--red);
}

.tech-card header span {
  color: var(--green);
}

.everyday-card header span {
  color: var(--orange);
}

.caption-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.06em;
  text-align: right;
}

.caption-card p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.48;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    padding-top: 30px;
  }

  .hero {
    margin-bottom: 44px;
  }

  .pipeline-grid,
  .caption-grid {
    grid-template-columns: 1fr;
  }

  .reader-card {
    min-height: 0;
  }

  .results-section {
    margin-top: 72px;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 3.55rem;
  }

  .intro {
    font-size: 1.05rem;
  }

  .upload-card,
  .reader-card,
  .caption-card {
    border-radius: 16px;
  }

  .upload-card,
  .reader-card {
    padding: 22px;
  }

  .upload-actions,
  .results-heading,
  .caption-card header {
    display: grid;
  }

  .primary-button {
    width: 100%;
  }

  .video-name {
    margin-left: 0;
  }

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