:root {
  --bg: #f4efe7;
  --panel: rgba(255, 250, 244, 0.88);
  --text: #1f1a17;
  --muted: #6b625c;
  --line: rgba(31, 26, 23, 0.1);
  --accent: #cc5a2e;
  --accent-strong: #9b2d12;
  --success: #286847;
  --warn: #9b6b12;
  --error: #a12828;
  --shadow: 0 24px 80px rgba(76, 42, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(204, 90, 46, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(32, 104, 71, 0.16), transparent 28%),
    linear-gradient(135deg, #f9f4ec 0%, #efe4d5 48%, #e8dccb 100%);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.55;
  pointer-events: none;
}

.backdrop-a {
  width: 20rem;
  height: 20rem;
  top: 8%;
  right: -5rem;
  background: rgba(204, 90, 46, 0.32);
}

.backdrop-b {
  width: 22rem;
  height: 22rem;
  left: -7rem;
  bottom: -6rem;
  background: rgba(40, 104, 71, 0.22);
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  margin-bottom: 24px;
  animation: rise 500ms ease-out both;
}

.eyebrow,
h1,
.lead,
.panel,
.dropzone,
.actions {
  animation: rise 540ms ease-out both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font: 700 0.9rem/1 "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lead {
  width: min(760px, 100%);
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.panel {
  margin-top: 20px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0;
  font: 700 1.2rem/1.2 "Space Grotesk", sans-serif;
}

.panel-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;
  background: rgba(31, 26, 23, 0.06);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status.pending {
  color: var(--warn);
}

.status.ready,
.status.success {
  color: var(--success);
}

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

.status.neutral {
  color: var(--muted);
}

.dropzone {
  display: block;
  padding: 30px;
  border: 1.5px dashed rgba(31, 26, 23, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2)),
    rgba(255, 247, 240, 0.72);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.dropzone:hover,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: rgba(204, 90, 46, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.25)),
    rgba(255, 243, 236, 0.95);
}

.dropzone input {
  display: none;
}

.dropzone-title {
  display: block;
  font: 700 1.12rem/1.4 "Space Grotesk", sans-serif;
}

.dropzone-subtitle {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.helper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.helper-card,
.progress-card,
.meta div {
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.helper-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
}

.helper-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.progress-card {
  margin-top: 18px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: "Space Grotesk", sans-serif;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 26, 23, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cf6235, #e89b58 55%, #286847);
  transition: width 240ms ease;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: 700 0.98rem/1 "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, filter 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

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

#decryptButton {
  color: #fff;
  background: linear-gradient(135deg, #cf6235, #9b2d12);
}

#downloadButton {
  color: var(--text);
  background: rgba(31, 26, 23, 0.08);
}

.meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}

.meta dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.meta dd {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
  word-break: break-all;
}

.log-panel {
  animation-delay: 80ms;
}

pre {
  min-height: 260px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 22px;
  background: #1c1917;
  color: #efe7dd;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: 400 0.92rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .helper-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 840px) {
  .shell {
    width: min(100% - 20px, 1100px);
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .panel-head,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
    min-height: 52px;
  }
}

@media (max-width: 520px) {
  .dropzone {
    padding: 24px 18px;
  }

  .dropzone-title {
    font-size: 1rem;
  }

  .lead,
  .dropzone-subtitle,
  .panel-copy,
  .helper-card span {
    font-size: 0.95rem;
  }

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