@font-face {
  font-family: "Averia Serif Libre";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/averia-serif-libre-italic-400.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --highlight-blue: #0064ff;
  --bg: #0d0b10;
  --surface: rgba(27, 24, 32, .92);
  --surface-strong: #211d27;
  --text: #f7f5f8;
  --muted: #aaa6ae;
  --line: rgba(255, 255, 255, .11);
  --danger: #ff8b94;
}

* { box-sizing: border-box; }
html, body, #app-root { min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

#hyperspeed-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
  opacity: .88;
}
#hyperspeed-root::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(7, 5, 11, .3);
}
#app-root {
  position: relative;
  z-index: 10;
  isolation: isolate;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell { min-height: 100svh; }
.site-main {
  width: 100%;
  min-height: 100svh;
  padding: 36px 20px;
  display: grid;
  place-items: center;
}

.home-view {
  position: relative;
  isolation: isolate;
  width: min(720px, 100%);
  text-align: center;
}
.hero-glow {
  position: absolute;
  z-index: 0;
  inset: -48svh -55vw;
  overflow: hidden;
  pointer-events: none;
  animation: hero-glow-enter 1.6s cubic-bezier(.33, 1, .68, 1) .3s both;
}
.hero-glow-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170vw;
  height: 120svh;
  display: block;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(50% 50% at 50% 50%, oklch(.55 .24 264 / .38), transparent 78%),
    radial-gradient(38% 44% at 62% 54%, oklch(.75 .12 230 / .24), transparent 76%),
    radial-gradient(34% 40% at 38% 54%, oklch(.7 .15 245 / .2), transparent 76%);
  filter: blur(48px);
  will-change: transform, opacity;
  animation: hero-glow-pulse 10s ease-in-out infinite;
}
@keyframes hero-glow-enter {
  from { opacity: 0; transform: translateY(28svh); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-49%, -51%) scale(1.06); opacity: .82; }
}
.hero-copy, .action-grid, .utility-actions { position: relative; z-index: 1; }
.hero-copy { margin-bottom: 30px; }
.hero-copy h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 500;
  text-wrap: balance;
}
.hero-copy h1 em {
  color: var(--highlight-blue);
  font-family: "Averia Serif Libre", Georgia, serif;
  font-size: 1.08em;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.022em;
  margin-right: -.04em;
}
.action-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.utility-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.utility-actions button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.38);
  background: transparent;
  color: #d1cdd4;
  font-size: 12px;
  cursor: pointer;
}
.utility-actions button:hover { border-color: #fff; color: #fff; }
.send-card {
  height: 50px;
  padding: 0 22px;
  border: 1px solid #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: #fff;
  color: #111014;
  cursor: pointer;
}
.send-card:hover { background: #eceaec; border-color: #eceaec; }
.send-card strong { font-size: 13px; font-weight: 600; }
.card-arrow { font-size: 18px; line-height: 1; }
.receive-card {
  width: 260px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-strong);
}
.pin-entry {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 48px;
}
.pin-entry input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 15px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.pin-entry input::placeholder { color: #c0bcc4; opacity: 1; }
.pin-entry input:focus { background: rgba(255,255,255,.035); }
.pin-entry button {
  border: 0;
  border-left: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.pin-entry button:hover { background: rgba(255,255,255,.06); }
.pin-entry button:disabled { opacity: .28; cursor: not-allowed; }
.pin-entry button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; }

.flow-card {
  width: min(680px, 100%);
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
  color: var(--text);
  backdrop-filter: blur(14px);
  text-align: left;
}
.flow-card h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 500;
}
.flow-card > p { margin: 0; color: var(--muted); font-size: 14px; }
.compact-card { max-width: 560px; }
.flow-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text);
}
.flow-icon svg, .primary-button svg, .drop-overlay svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.loader {
  width: 30px;
  height: 30px;
  margin: 0 0 20px;
  display: block;
  border: 2px solid rgba(255,255,255,.14);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-label, .time-line { margin-top: 24px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.progress-label strong, .time-line strong { color: var(--text); }
.progress-track { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .18s ease; }

.success-mark {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 13px;
}
.share-grid { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pin-share, .qr-share {
  min-height: 240px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pin-share > small { color: var(--muted); font-size: 10px; }
.big-pin {
  margin: 14px 0 18px;
  padding: 0 0 0 .1em;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(46px, 9vw, 66px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: .1em;
  cursor: pointer;
}
.qr-share canvas { width: 164px !important; height: 164px !important; margin-bottom: 12px; border: 8px solid #fff; border-radius: 7px; background: #fff; }
.secondary-button, .text-button, .primary-button { border: 0; cursor: pointer; text-decoration: none; }
.secondary-button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}
.secondary-button:hover { background: rgba(255,255,255,.06); }

.file-list { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.1); }
.file-item { min-width: 0; padding: 10px 12px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.file-item:last-child { border-bottom: 0; }
.file-mark { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: var(--muted); font-size: 9px; font-weight: 600; }
.file-info { min-width: 0; }
.file-info strong, .file-info small { display: block; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.file-info small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111014;
}
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.footer-actions { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.primary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #111014;
  font-weight: 600;
}
.primary-button:hover { background: #eceaec; }
.text-button { padding: 9px 0; background: transparent; color: var(--muted); }
.text-button:hover { color: var(--text); }
.text-button.danger { color: var(--danger); }
.download-all { width: 100%; margin-top: 20px; }
.download-all svg { width: 18px; }
.received-view > .text-button { margin-top: 10px; }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #211d27;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  color: #fff;
  font-size: 13px;
}
.toast.error { color: #ffc1c6; }
.qr-dialog-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 7, .76);
  backdrop-filter: blur(8px);
}
.qr-dialog {
  position: relative;
  width: min(340px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #17141d;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
  text-align: center;
}
.qr-dialog h2 {
  margin: 0 32px 20px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 500;
}
.qr-dialog canvas {
  display: block;
  width: min(240px, 100%) !important;
  height: auto !important;
  margin: 0 auto;
  border: 10px solid #fff;
  border-radius: 9px;
  background: #fff;
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { background: rgba(255,255,255,.06); color: #fff; }
.drop-overlay {
  position: fixed;
  z-index: 70;
  inset: 18px;
  border: 1px dashed rgba(255,255,255,.7);
  border-radius: 14px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(13,11,16,.92);
  color: #fff;
  font-size: 18px;
  pointer-events: none;
}
.drop-overlay svg { width: 38px; }

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 580px) {
  .site-main { padding: 28px 16px; }
  .hero-copy { margin-bottom: 24px; }
  .hero-copy h1 { font-size: clamp(32px, 10vw, 40px); }
  .action-grid { width: min(340px, 100%); margin: 0 auto; flex-direction: column; }
  .send-card, .receive-card { width: 100%; }
  .flow-card { padding: 24px 18px; }
  .share-grid { grid-template-columns: 1fr; }
  .pin-share, .qr-share { min-height: 215px; }
  .footer-actions { flex-direction: column-reverse; align-items: stretch; }
  .footer-actions .primary-button, .footer-actions .text-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .hero-glow { opacity: 1; transform: none; }
  .hero-glow-core { transform: translate(-50%, -50%); }
}
