/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #161b22; padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* ── Header ──────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid #21262d;
}
header h1 { font-size: 1.5rem; font-weight: 700; }
header h1 a { color: #e6edf3; }
.dot { color: #58a6ff; }
nav { display: flex; gap: 1.5rem; }
nav a { color: #8b949e; font-weight: 500; }
nav a:hover, nav a.active { color: #e6edf3; text-decoration: none; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
}
.hero h2 {
  font-size: 2.4rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero p { color: #8b949e; font-size: 1.15rem; margin-bottom: 2rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #2ea043; text-decoration: none; }
.btn-secondary { background: #21262d; }
.btn-secondary:hover { background: #30363d; }

/* ── Cards ───────────────────────────────────────────────── */
.services, .api-docs { padding: 3rem 2rem; max-width: 900px; margin: 0 auto; }
.services h2, .api-docs h2 { margin-bottom: 1.5rem; font-size: 1.8rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 1.5rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: #8b949e; font-size: 0.95rem; margin-bottom: 0.75rem; }
.badge {
  display: inline-block;
  background: #30363d;
  color: #8b949e;
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── API Docs ────────────────────────────────────────────── */
.endpoint {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.endpoint code { background: #0d1117; font-weight: 600; }
.protocol-steps { padding-left: 1.5rem; color: #8b949e; }
.protocol-steps li { margin-bottom: 0.5rem; }
.protocol-steps strong { color: #e6edf3; }

/* ── Transfer Page ───────────────────────────────────────── */
.transfer-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}
.phase { text-align: center; }
.phase h2 { margin-bottom: 0.75rem; }
.phase p { color: #8b949e; margin-bottom: 1rem; }
.hidden { display: none !important; }

/* QR container */
.qr-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}
.qr-container canvas { border-radius: 8px; }
.qr-loading { color: #8b949e; padding: 4rem 0; }

/* Status bar */
.status-bar {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.status-bar.secure { background: #0d2818; color: #3fb950; border: 1px solid #238636; }

/* File input */
.transfer-controls { margin: 1.5rem 0; }
.file-pick { position: relative; overflow: hidden; }
.file-pick input[type="file"] {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Offer card */
.offer {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  color: #8b949e;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
}
.offer-actions { display: flex; gap: 1rem; justify-content: center; }

/* Progress */
.progress-bar {
  width: 100%;
  height: 12px;
  background: #21262d;
  border-radius: 99px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #238636, #3fb950);
  border-radius: 99px;
  transition: width 0.2s;
}
#progress-text { font-variant-numeric: tabular-nums; }

/* Spinner */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #21262d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.5rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Complete phase */
#download-link { margin-bottom: 1rem; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  color: #484f58;
  border-top: 1px solid #21262d;
  font-size: 0.85rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  header { flex-direction: column; gap: 0.75rem; }
  .hero h2 { font-size: 1.6rem; }
  .transfer-page { padding: 1rem; }
}
