:root {
  --ink: #0b1020;
  --ink-soft: rgba(11, 16, 32, 0.62);
  --paper: #eef2f8;
  --glass-fill: rgba(255, 255, 255, 0.14);
  --glass-fill-strong: rgba(255, 255, 255, 0.24);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: rgba(20, 30, 70, 0.35);
  --azure: #4fb7ff;
  --violet: #9d7bff;
  --teal: #46e5c2;
  --coral: #ff9d7a;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Space Grotesk", ui-sans-serif, sans-serif;
  --font-body: "Inter", ui-sans-serif, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #0c1330;
  color: var(--paper);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ---------- fluid animated background ---------- */
.fluid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 15% 8%, #1a2452 0%, transparent 55%),
    radial-gradient(120% 100% at 85% 92%, #131c3f 0%, transparent 55%),
    linear-gradient(160deg, #0a0f24 0%, #0c1330 50%, #0a1122 100%);
}

.fluid-bg svg { position: absolute; width: 0; height: 0; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  mix-blend-mode: screen;
  opacity: 0.65;
  will-change: transform;
}

.blob-a {
  width: 46vmax; height: 46vmax;
  left: -14vmax; top: -10vmax;
  background: radial-gradient(circle at 35% 35%, var(--azure), transparent 70%);
  animation: drift-a 26s ease-in-out infinite;
}
.blob-b {
  width: 40vmax; height: 40vmax;
  right: -12vmax; top: 6vmax;
  background: radial-gradient(circle at 60% 40%, var(--violet), transparent 70%);
  animation: drift-b 32s ease-in-out infinite;
}
.blob-c {
  width: 38vmax; height: 38vmax;
  left: 18vmax; bottom: -16vmax;
  background: radial-gradient(circle at 50% 50%, var(--teal), transparent 72%);
  animation: drift-c 28s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, 8vmax) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-7vmax, 5vmax) scale(0.94); }
}
@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vmax, -6vmax) scale(1.08); }
}

/* ---------- layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 48px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.masthead {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 242, 248, 0.55);
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 9vw, 52px);
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffffff 10%, #bcd4ff 45%, #d9c8ff 75%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 auto;
  max-width: 38ch;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(238, 242, 248, 0.72);
}

/* ---------- glass card ---------- */
.glass-card {
  width: 100%;
  position: relative;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, var(--glass-fill-strong), var(--glass-fill) 60%);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 20px 60px -20px var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 12px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.4s ease;
}

.dropzone {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  padding: 38px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.25s ease;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.dropzone.drag-over {
  border-color: var(--teal);
  background: rgba(70, 229, 194, 0.12);
  transform: scale(1.015);
}

.dropzone.has-file {
  padding: 20px;
}

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(238, 242, 248, 0.85);
}

.drop-icon {
  color: rgba(238, 242, 248, 0.8);
  animation: bob 3.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.drop-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}

.drop-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(238, 242, 248, 0.55);
}

.drop-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--azure);
}

/* ---------- file chip ---------- */
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.chip-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--azure), var(--violet));
  color: #0b1020;
}

.chip-meta { flex: 1; min-width: 0; }

.chip-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-size {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(238, 242, 248, 0.55);
}

.chip-remove {
  background: none;
  border: none;
  color: rgba(238, 242, 248, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.chip-remove:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- send button ---------- */
.send-btn {
  border: none;
  border-radius: 999px;
  padding: 15px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: #0b1020;
  background: linear-gradient(100deg, var(--teal), var(--azure) 60%, var(--violet));
  background-size: 200% 100%;
  cursor: pointer;
  transition: background-position 0.5s ease, transform 0.15s ease, opacity 0.2s ease;
  box-shadow: 0 12px 30px -10px rgba(79, 183, 255, 0.55);
}

.send-btn:hover:not(:disabled) { background-position: 100% 0; }
.send-btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.send-btn.sending .send-label::after {
  content: "";
}

/* ---------- progress ---------- */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--azure));
  transition: width 0.2s ease;
}

/* ---------- result ---------- */
.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(70, 229, 194, 0.1);
  border: 1px solid rgba(70, 229, 194, 0.35);
  animation: rise 0.4s ease;
}

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

.result-label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--teal);
}

.result-row {
  display: flex;
  gap: 8px;
}

.result-link {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(11, 16, 32, 0.35);
  color: var(--paper);
  font-size: 13px;
  font-family: var(--font-body);
}

.copy-btn, .reset-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--paper);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.copy-btn:hover, .reset-btn:hover { background: rgba(255, 255, 255, 0.22); }

.reset-btn {
  align-self: flex-start;
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 2px;
  color: rgba(238, 242, 248, 0.75);
}

/* ---------- error ---------- */
.error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffd7d7;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- footer ---------- */
.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(238, 242, 248, 0.4);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

@media (max-width: 380px) {
  .stage { padding-top: 32px; }
  .dropzone { padding: 30px 14px; }
}
