:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #2b2b2b;
  --muted: #6e6e6a;
  --line: #ebebe7;
  --soft: #f7f7f5;
  --ok: #1a8d5f;
  --warn: #b26b00;
  --err: #d23f3f;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, .03), 0 12px 24px -8px rgba(0, 0, 0, .06), 0 40px 80px -24px rgba(0, 0, 0, .10);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 14px 28px -10px rgba(0, 0, 0, .45), 0 4px 10px -4px rgba(0, 0, 0, .3);
  --font: "Inter Tight", "Neue Montreal", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: #0b0b0b; color: #fff; }

/* Landscape backdrop, washed out and faded into the page */
.hero-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 900px;
  background: url("/hero.webp") center 62% / cover no-repeat;
  z-index: -1;
  animation: bgIn 1.6s var(--ease) both;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(246, 246, 244, .86) 0%, rgba(246, 246, 244, .72) 38%, rgba(246, 246, 244, .55) 62%, var(--bg) 100%);
}
@keyframes bgIn { from { opacity: 0; transform: scale(1.04); } }

/* Header */
.top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mark { display: flex; align-items: center; }
.mark img { display: block; height: 30px; width: auto; }
h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font: 500 16px/1 var(--font);
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .3s, color .3s, opacity .3s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn.dark {
  color: #fff;
  background: linear-gradient(180deg, #3a3a3a 0%, #0b0b0b 55%);
  box-shadow: var(--shadow-btn);
}
.btn.dark:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 20px 34px -12px rgba(0,0,0,.5), 0 6px 14px -6px rgba(0,0,0,.3); }
.btn.light {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -12px rgba(0, 0, 0, .18);
}
.btn.light:hover { transform: translateY(-2px); }
.btn.sm { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; margin-top: 18px; padding: 17px; font-size: 17px; }
.btn.ghost { background: none; color: var(--muted); padding: 10px 16px; font-size: 15px; }
.btn.ghost:hover { color: var(--err); }
.btn.copied { background: linear-gradient(180deg, #2a9d6e 0%, #157a52 60%); }

/* Layout */
.stage { max-width: 760px; margin: 0 auto; padding: 28px 20px 140px; }

.panel { animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }

.hero { text-align: center; }
.hero > * { animation: rise .9s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3) { animation-delay: .12s; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px 9px 10px;
  font-size: 15px;
  color: var(--ink-2);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .15);
}
.pulse {
  width: 8px; height: 8px; margin-left: 8px; border-radius: 50%;
  background: #22b573;
  box-shadow: 0 0 0 0 rgba(34, 181, 115, .5);
  animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 181, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 181, 115, 0); } }

h1 {
  margin: 22px 0 0;
  font-size: clamp(38px, 6.4vw, 64px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.035em;
  color: var(--ink);
}
h1 em { font-size: 1.08em; }
.hero h1:first-child { margin-top: 12px; }
.lede {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -.01em;
}

/* Card */
.card {
  margin-top: 36px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-radius: 28px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  animation: rise 1s var(--ease) .18s both;
}
#send .card, #recv .card { padding: 22px; }

/* Drop zone */
.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 52px 24px 44px;
  border-radius: 20px;
  border: 1.5px dashed #dcdcd6;
  background: var(--soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .5s var(--ease);
}
.drop:hover { border-color: #b8b8b0; background: #f2f2ef; }
.drop.drag { border-color: var(--ink); background: #efefeb; transform: scale(.99); }
.drop-icon {
  width: 60px; height: 60px; margin-bottom: 18px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 24px -10px rgba(0,0,0,.18);
  transition: transform .6s var(--ease);
}
.drop:hover .drop-icon { transform: translateY(-4px); }
.drop-icon svg { width: 26px; height: 26px; stroke: var(--ink); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.drop strong { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.drop-sub { margin-top: 4px; color: var(--muted); font-size: 15px; }
.drop-btn { margin-top: 24px; pointer-events: none; }

/* Link row */
.linkrow { display: flex; gap: 8px; }
.linkrow input {
  flex: 1; min-width: 0;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  padding: 0 22px;
  font: 15px var(--font);
  letter-spacing: -.01em;
  transition: box-shadow .3s;
}
.linkrow input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Files */
.files { margin-top: 18px; border-radius: 18px; background: var(--soft); padding: 16px 18px; }
#recv .files { margin-top: 0; }
#recv .meter:not([hidden]) + .files { margin-top: 18px; }
.files-head { display: flex; justify-content: space-between; align-items: baseline; }
.files-count { font-weight: 500; font-size: 16px; letter-spacing: -.01em; }
.files-total { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.files-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.files-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 9px 0; font-size: 15px;
  border-top: 1px solid var(--line);
}
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fext {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2);
}
.fsize { color: var(--muted); flex: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.files-list .more { color: var(--muted); justify-content: center; }
.skeleton { height: 14px; margin-top: 14px; border-radius: 7px; width: 80%; background: linear-gradient(90deg, #ececE8 0%, #f6f6f3 50%, #ececE8 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.short { width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Receiver meter */
.meter { animation: rise .7s var(--ease) both; }
.meter-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.pct { font-size: 56px; font-weight: 500; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.rate { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; padding-bottom: 6px; text-align: right; }
.bytes { margin-top: 10px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: #ececE8; overflow: hidden; }
.bar > div {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #2b2b2b, #0b0b0b);
  transition: width .6s var(--ease);
  position: relative;
}
.bar > div::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: sheen 1.6s linear infinite;
}
@keyframes sheen { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* Receivers (sender side) */
.peers { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.peer {
  border-radius: 16px; padding: 14px 16px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  animation: rise .6s var(--ease) both;
}
.peer-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 15px; }
.peer-name { font-weight: 500; }
.peer-state { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.peer .bar { height: 6px; }
.peer.done .peer-state { color: var(--ok); font-weight: 500; }
.peer.done .bar > div { background: var(--ok); }
.peer.done .bar > div::after, .peer.lost .bar > div::after { display: none; }
.peer.lost .peer-state { color: var(--warn); }
.peer.error .peer-state { color: var(--err); }

.status { margin-top: 16px; font-size: 15px; color: var(--muted); text-align: center; min-height: 22px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.err { color: var(--err); }
.note { margin: 14px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

#stopBtn { display: flex; margin: 22px auto 0; }

/* Floating dock (Orbix-style) */
.dock {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  min-width: 300px; max-width: calc(100vw - 32px);
  padding: 10px 22px 10px 10px;
  border-radius: 999px;
  background: #0b0b0b;
  color: #fff;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .45);
  z-index: 10;
  animation: dockIn 1s var(--ease) .4s both;
}
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 30px); } }

.dock-logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #1f1f1f; flex: none; }
.dock-logo img { width: 20px; height: 20px; }
.dock-text { flex: 1; font-size: 15px; color: #d6d6d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-pct { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; padding-left: 16px; border-left: 1px solid #333; }
.dock-pct:empty { display: none; }

@media (max-width: 640px) {
  .top { padding: 16px; }
  .mark img { height: 26px; }
  .stage { padding-top: 28px; }
  .lede { font-size: 16px; }
  .card { margin-top: 32px; border-radius: 24px; }
  #send .card, #recv .card { padding: 16px; }
  .linkrow { flex-wrap: wrap; }
  .linkrow input { flex-basis: 100%; height: 50px; }
  .linkrow .btn { flex: 1; }
  .pct { font-size: 44px; }
  .dock { bottom: 16px; min-width: 0; width: calc(100vw - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
