:root {
  --bg: #f7f4ec;
  --ink: #171511;
  --muted: #6f6a60;
  --line: #ded6c4;
  --line-strong: #b8aa8f;
  --surface: #fffdf8;
  --surface-soft: #eee7d8;
  --accent: #0f766e;
  --accent-dark: #0b514d;
  --accent-soft: #d8f3ed;
  --copper: #b35c2e;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(42, 31, 16, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(23, 21, 17, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 21, 17, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 12% 10%, rgba(179, 92, 46, 0.16), transparent 28%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--ink);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
}

.topbar {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand {
  gap: 10px;
  font: 800 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 64px) 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 6vw, 72px);
  align-items: center;
}

.hero {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--copper);
  font: 800 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
  text-wrap: balance;
}

.lead {
  max-width: 620px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
}

.lead code {
  font: 0.82em/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 253, 248, 0.82);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--muted);
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.steps span {
  color: var(--accent-dark);
}

.publish-card {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.uploader {
  display: grid;
  gap: 14px;
}

.dropzone {
  position: relative;
  min-height: 270px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 26px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), transparent 42%),
    var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging,
.dropzone.has-file {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 46%),
    var(--surface);
}

.dropzone.is-dragging {
  transform: translateY(-2px);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent-soft);
}

.drop-icon span {
  width: 20px;
  height: 26px;
  display: block;
  border: 2px solid var(--accent-dark);
  border-top-width: 8px;
  border-radius: 3px;
}

.drop-title {
  font: 800 19px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.drop-subtitle,
.file-meta,
.status {
  color: var(--muted);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.file-meta {
  min-height: 20px;
  color: var(--accent-dark);
  word-break: break-word;
}

.title-field {
  display: grid;
  gap: 7px;
}

.title-field span {
  color: var(--muted);
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0 13px;
}

button,
.open-link {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font: 800 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-decoration: none;
}

#publish-button {
  width: 100%;
  background: var(--accent);
  color: white;
}

#publish-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

#publish-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.44);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

#publish-button.is-loading .button-spinner {
  display: inline-block;
}

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

.result-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.34);
  border-radius: 8px;
  background: var(--accent-soft);
}

.result-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.published-link {
  display: block;
  color: var(--accent-dark);
  font: 800 15px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

#copy-link {
  background: var(--ink);
  color: white;
}

.open-link {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.status {
  min-height: 22px;
  margin: 14px 0 0;
}

.status[data-tone="success"] {
  color: var(--accent-dark);
}

.status[data-tone="error"] {
  color: var(--danger);
}

@media (max-width: 860px) {
  .topbar {
    min-height: 64px;
  }

  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 22px;
  }

  .publish-card {
    order: -1;
  }

  .dropzone {
    min-height: 230px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}
