:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #f7f7f8;
  --ink: #111111;
  --muted: #626262;
  --rule: #d8d8d8;
  --accent: #e4002b;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

.masthead {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.wordmark {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

main {
  width: min(100% - 2.5rem, 45rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.intro {
  margin-bottom: 2rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.lede {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.upload-panel {
  border: 1px solid var(--ink);
  background: var(--paper);
}

.panel-heading {
  display: grid;
  grid-template-columns: 1fr minmax(12rem, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.panel-heading h2,
.panel-heading p {
  margin: 0;
}

.panel-heading h2 {
  font-size: 0.95rem;
}

.panel-heading p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

form {
  padding: 1.25rem;
}

.drop-zone {
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1px dashed var(--muted);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-within,
.drop-zone.is-dragging {
  border-color: var(--accent);
  color: var(--accent);
}

.drop-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.drop-detail {
  color: var(--muted);
  font-size: 0.85rem;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  margin-top: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.file-name,
.file-size {
  margin: 0;
}

.file-name {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.error {
  min-height: 1.25rem;
  margin: 0.75rem 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.progress-area {
  margin-block: 0.75rem 1.25rem;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.progress-copy p {
  margin: 0;
}

progress {
  width: 100%;
  height: 0.35rem;
  display: block;
  border: 0;
  border-radius: 0;
  background: var(--rule);
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--rule);
}

progress::-webkit-progress-value {
  background: var(--accent);
}

progress::-moz-progress-bar {
  background: var(--accent);
}

button {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--paper);
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

button:hover:not(:disabled) {
  color: var(--accent);
  background: var(--paper);
}

button:focus-visible,
.drop-zone:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  border-color: var(--rule);
  color: var(--muted);
  background: var(--rule);
  cursor: not-allowed;
}

.success {
  padding: 2rem 1.25rem;
}

.success-title {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.success p:not(.success-title) {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.text-button {
  width: auto;
  min-height: auto;
  margin-top: 1.75rem;
  padding: 0 0 0.2rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  background: transparent;
  font-weight: 400;
}

.text-button:hover {
  color: var(--accent);
  background: transparent;
}

.storage-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

@media (max-width: 560px) {
  main {
    width: min(100% - 2rem, 45rem);
    padding-block: 2.5rem;
  }

  .panel-heading {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .masthead {
    padding-inline: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
