/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0a;
  --bg-raised: #131313;
  --line: #232323;
  --ink: #ededed;
  --muted: #8a8a8a;
  --lime: #c6ff3b;
  --lime-dim: #8fbf22;
  --danger: #ff5a5a;
  --radius: 14px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

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

/* ---------- Background particle field ---------- */
#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
}

/* ---------- Watermark ---------- */
.watermark {
  position: fixed;
  bottom: 16px;
  right: 20px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 560px) {
  .watermark {
    bottom: 54px;
    right: 14px;
    font-size: 0.64rem;
  }
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 0;
}

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

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(198, 255, 59, 0.6);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

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

.meter-track {
  width: 140px;
  height: 6px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lime-dim), var(--lime));
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}

.meter-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 70px;
}

/* ---------- Layout ---------- */
.view {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: 100%;
  max-width: 640px;
  padding: 64px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.sub {
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.55;
  margin: 0 0 40px;
  font-size: 1rem;
}

/* ---------- Dropzone ---------- */
.dropzone {
  width: 100%;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  cursor: pointer;
  background: rgba(19, 19, 19, 0.5);
  backdrop-filter: blur(6px);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.dropzone:hover {
  border-color: #3a3a3a;
}

.dropzone.dragover {
  border-color: var(--lime);
  background: rgba(198, 255, 59, 0.06);
  transform: scale(1.01);
  animation: pulse-glow 1.4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(198, 255, 59, 0); }
  50% { box-shadow: 0 0 40px rgba(198, 255, 59, 0.18); }
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.dz-icon {
  width: 44px;
  height: 44px;
  color: var(--muted);
  margin-bottom: 8px;
  transition: color 0.25s ease, transform 0.25s ease;
}

.dropzone.dragover .dz-icon {
  color: var(--lime);
  transform: translateY(-4px);
}

.dz-text {
  color: var(--ink);
  font-size: 1.02rem;
  margin: 0;
}

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

.dz-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ---------- Upload progress ---------- */
.upload-panel {
  width: 100%;
  margin-top: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
  animation: rise 0.35s ease both;
}

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

.upload-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.upload-name {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.upload-pct {
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  border-radius: 6px;
  background: #1c1c1c;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--lime-dim), var(--lime));
  position: relative;
  transition: width 0.15s linear;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  width: 40px;
  animation: sheen 1.1s linear infinite;
}

@keyframes sheen {
  from { transform: translateX(-40px); }
  to { transform: translateX(220px); }
}

/* ---------- Result ---------- */
.result-panel {
  width: 100%;
  margin-top: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  animation: pop-in 0.4s cubic-bezier(.2,.9,.25,1.3) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-label {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: 0.85rem;
  font-weight: 500;
}

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

.result-row input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.btn-copy {
  background: var(--lime);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-copy:hover { transform: translateY(-1px); }
.btn-copy.copied { background: #fff; }

.btn-ghost {
  margin-top: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.btn-ghost:hover { color: var(--ink); }

/* ---------- Visibility switch ---------- */
.visibility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.visibility-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.visibility-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.visibility-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.switch {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1c1c1c;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch[aria-checked="true"] {
  background: var(--lime-dim);
  border-color: var(--lime-dim);
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1);
}

.switch[aria-checked="true"] .switch-knob {
  transform: translateX(18px);
  background: #0a0a0a;
}

/* ---------- Delete controls ---------- */
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.86rem;
  padding: 0;
}

.btn-delete:hover { opacity: 0.8; }

.confirm-panel {
  width: 100%;
  margin-top: 22px;
  background: rgba(255, 90, 90, 0.06);
  border: 1px solid rgba(255, 90, 90, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
  animation: rise 0.3s ease both;
}

.confirm-text {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 0.92rem;
}

.confirm-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.btn-delete-solid {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.btn-delete-solid:hover { opacity: 0.9; }

/* ---------- My files (this device) ---------- */
.mine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.mine-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mine-name {
  font-size: 0.88rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.mine-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.mine-badge.is-public {
  color: var(--lime);
  border-color: var(--lime-dim);
}

.mine-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.mine-link {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mine-link:hover { color: var(--ink); }

/* ---------- Owner controls on the file page ---------- */
.owner-controls {
  margin-top: 8px;
  text-align: left;
}

.owner-controls .btn-delete {
  margin-top: 16px;
  display: block;
}

/* ---------- Error ---------- */
.error-panel {
  width: 100%;
  margin-top: 22px;
  background: rgba(255, 90, 90, 0.06);
  border: 1px solid rgba(255, 90, 90, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
  animation: rise 0.35s ease both;
}

.error-panel p {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 0.92rem;
}

/* ---------- Recent files ---------- */
.recent {
  width: 100%;
  max-width: 900px;
  padding: 40px 24px 80px;
}

.recent-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ---------- Share / file page ---------- */
.filecard-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 40px 24px;
}

.filecard {
  width: 100%;
  max-width: 420px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 32px;
  text-align: center;
  animation: rise 0.45s cubic-bezier(.2,.9,.25,1) both;
}

.filecard-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--lime);
}

.filecard-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 6px;
  word-break: break-word;
}

.filecard-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 28px;
}

.btn-download {
  display: inline-block;
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(198, 255, 59, 0.18);
}

.filecard-note {
  margin: 20px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  color: #5a5a5a;
  font-size: 0.78rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .topbar { padding: 20px 20px 0; }
  .meter-track { width: 90px; }
  .hero { padding: 44px 18px 10px; }
  .dropzone { padding: 40px 16px; }
}
