:root {
  --bg: #0a0d12;
  --bg-soft: #11161f;
  --panel: #141a24;
  --panel-2: #1a2230;
  --border: #232c3b;
  --border-soft: #1c2533;
  --text: #e6edf6;
  --text-dim: #8a98ac;
  --text-faint: #5b6878;
  --accent: #3ddc97;
  --accent-soft: rgba(61, 220, 151, 0.14);
  --accent-glow: rgba(61, 220, 151, 0.35);
  --danger: #ff5d6c;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 70%);
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(61, 220, 151, 0.25);
  border-radius: 10px;
}

.brand-name {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.header-link {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.header-link:hover { color: var(--text); border-color: var(--accent); }

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 80px;
}

.view { width: 100%; max-width: 620px; }

.hero { text-align: center; margin-bottom: 34px; }

.vault-emblem {
  width: 96px; height: 96px;
  margin: 0 auto 22px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 220, 151, 0.22);
  border-radius: 24px;
  box-shadow: 0 0 40px -8px var(--accent-glow), inset 0 0 30px -18px var(--accent-glow);
  animation: emblemFloat 4s ease-in-out infinite;
}
@keyframes emblemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.subtitle {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 15px;
}

.dropzone {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.dropzone:hover { border-color: rgba(61, 220, 151, 0.5); background: linear-gradient(180deg, var(--panel-2), var(--bg-soft)); }
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.1), 0 20px 50px -20px var(--accent-glow);
}

.dropzone-inner { pointer-events: none; }

.drop-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  border: 1px solid rgba(61, 220, 151, 0.2);
  transition: transform 0.25s ease;
}
.dropzone:hover .drop-icon { transform: translateY(-3px); }

.drop-title { font-size: 17px; font-weight: 600; }
.drop-sub { margin-top: 6px; color: var(--text-dim); font-size: 14px; }
.browse-btn { color: var(--accent); font-weight: 600; }

.progress-wrap {
  margin-top: 28px;
  text-align: left;
  animation: fadeUp 0.3s ease;
}
.progress-info { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-name { font-size: 13px; font-family: var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.progress-pct { font-size: 13px; font-family: var(--mono); color: var(--accent); font-weight: 600; }

.progress-track {
  height: 8px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6ef0b8);
  border-radius: 999px;
  transition: width 0.15s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}
.progress-size { margin-top: 8px; font-size: 12px; color: var(--text-faint); font-family: var(--mono); }

.result { margin-top: 28px; animation: fadeUp 0.35s ease; }
.result-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}
.result-check {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 220, 151, 0.25);
  border-radius: 50%;
  animation: pop 0.4s ease;
}
.result-card h2 { font-size: 20px; font-weight: 600; }
.result-filename { margin-top: 6px; color: var(--text-dim); font-family: var(--mono); font-size: 13px; word-break: break-all; }

.link-label { display: block; margin-top: 22px; font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}
.link-input:focus { border-color: var(--accent); }
.copy-btn {
  background: var(--accent);
  color: #06281a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover { background: #6ef0b8; }
.copy-btn.copied { background: var(--bg-soft); color: var(--accent); border: 1px solid var(--accent); }

.result-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--accent); color: #06281a; }
.btn-primary:hover { background: #6ef0b8; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.toast {
  margin-top: 18px;
  padding: 12px 18px;
  background: rgba(255, 93, 108, 0.1);
  border: 1px solid rgba(255, 93, 108, 0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
  animation: fadeUp 0.25s ease;
}

/* File view */
.file-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  animation: fadeUp 0.35s ease;
}
.file-card-head { display: flex; align-items: center; gap: 16px; }
.file-icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(61, 220, 151, 0.25);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.file-meta { min-width: 0; }
.file-meta h2 { font-size: 18px; font-weight: 600; word-break: break-all; }
.file-stats { margin-top: 4px; color: var(--text-dim); font-size: 13px; font-family: var(--mono); }

.file-preview {
  margin-top: 22px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  max-height: 520px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.file-preview img, .file-preview video, .file-preview audio { max-width: 100%; max-height: 520px; display: block; }
.file-preview .text-preview { padding: 18px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); white-space: pre-wrap; overflow: auto; max-height: 520px; width: 100%; }

.file-actions { display: flex; gap: 10px; margin-top: 24px; }
.file-error { margin-top: 18px; color: var(--danger); font-size: 14px; text-align: center; }

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--text-faint);
  font-size: 12px;
}

.hidden { display: none !important; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

@media (max-width: 560px) {
  .site-header { padding: 18px 18px; }
  .dropzone { padding: 36px 18px; }
  .result-card, .file-card { padding: 24px 18px; }
  .link-row { flex-direction: column; }
  .copy-btn { padding: 12px; }
  .result-actions, .file-actions { flex-direction: column; }
  .btn { width: 100%; }
}
