:root {
  --bg: #0c0e11;
  --surface: #14171c;
  --surface-2: #1a1e25;
  --border: #262b34;
  --text: #e9edf2;
  --text-dim: #8b93a1;
  --accent: #3ddc84;
  --accent-dim: rgba(61, 220, 132, 0.12);
  --blue: #4c8df6;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
}

.main {
  padding: 48px 40px 64px;
  min-width: 0;
}

/* ---------- Header ---------- */

.header { margin-bottom: 36px; }

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(61, 220, 132, 0.25);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 18px;
  animation: rise 0.5s var(--ease-out) both;
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
}

.header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  animation: rise 0.5s var(--ease-out) 0.06s both;
}

.header-sub {
  color: var(--text-dim);
  max-width: 480px;
  margin-top: 12px;
  animation: rise 0.5s var(--ease-out) 0.12s both;
}

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

/* ---------- Recipient ---------- */

.recipient {
  margin-bottom: 32px;
  animation: rise 0.5s var(--ease-out) 0.18s both;
}

.recipient label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.recipient-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

#to {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  padding: 12px 16px;
  width: 260px;
  outline: none;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

#to:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.recipient-hint { font-size: 12.5px; color: var(--text-dim); }

/* ---------- Demo grid ---------- */

.demos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: rise 0.55s var(--ease-out) both;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.demo-card:hover {
  transform: translateY(-3px);
  border-color: #333a46;
}

/* Phone-frame preview */
.preview {
  background: #07090c;
  padding: 22px 22px 18px;
  display: flex;
  justify-content: center;
}

.bubble {
  width: 100%;
  max-width: 232px;
  background: var(--surface-2);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  overflow: hidden;
  font-size: 11px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.bubble-img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.bubble-body { padding: 10px 12px; }
.bubble-title { font-weight: 600; font-size: 12px; margin-bottom: 3px; }
.bubble-text { color: var(--text-dim); line-height: 1.4; }

.bubble-btns { border-top: 1px solid var(--border); }

.bubble-btn {
  padding: 7px 12px;
  color: var(--blue);
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.bubble-btn:last-child { border-bottom: none; }

/* transaction card preview */
.tx-head { padding: 12px 12px 10px; }
.tx-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.tx-line { font-size: 10px; opacity: 0.85; }
.tx-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 2px 0 10px;
}
.tx-secure {
  font-size: 9px;
  opacity: 0.75;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 7px;
}

/* chip list preview */
.chips { display: flex; gap: 6px; margin-top: 10px; overflow: hidden; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--blue);
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
}

/* carousel preview */
.carousel-strip { display: flex; gap: 8px; width: 100%; overflow: hidden; }
.carousel-strip .bubble {
  border-radius: 14px;
  flex-shrink: 0;
  width: 130px;
}
.carousel-strip .bubble-img { height: 64px; }
.carousel-strip .bubble-body { padding: 8px 10px; }
.carousel-strip .bubble-btn { padding: 6px 10px; }

/* webview preview */
.webview-sheet {
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 8px 12px 14px;
  width: 100%;
  max-width: 232px;
}
.webview-grabber {
  width: 32px; height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 8px;
}
.webview-line {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 6px;
}
.webview-line.short { width: 60%; }

/* card meta + send */
.demo-meta {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.demo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.demo-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.demo-badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  color: #f6b04c;
  background: rgba(246, 176, 76, 0.12);
  border: 1px solid rgba(246, 176, 76, 0.25);
}

.demo-desc { color: var(--text-dim); font-size: 13.5px; flex: 1; }

.send-btn {
  margin-top: 12px;
  position: relative;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #06130b;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 0;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s var(--ease-out), transform 0.12s var(--ease-out),
    opacity 0.2s var(--ease-out);
}

.send-btn:hover:not(:disabled) { background: #4ce694; }
.send-btn:active:not(:disabled) { transform: scale(0.98); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.send-btn .btn-label {
  display: inline-block;
  transition: opacity 0.18s var(--ease-in), transform 0.18s var(--ease-in);
}

.send-btn.is-sending .btn-label,
.send-btn.is-sent .btn-label,
.send-btn.is-error .btn-label { opacity: 0; transform: translateY(-8px); }

.send-btn .btn-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  pointer-events: none;
}

.send-btn.is-sending .btn-state.sending,
.send-btn.is-sent .btn-state.sent,
.send-btn.is-error .btn-state.error {
  opacity: 1;
  transform: translateY(0);
}

.send-btn.is-error { background: #f66d6d; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(6, 19, 11, 0.25);
  border-top-color: #06130b;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.checkmark {
  width: 15px; height: 15px;
}
.checkmark path {
  stroke: #06130b;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.send-btn.is-sent .checkmark path {
  animation: draw 0.4s var(--ease-out) 0.1s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Feed ---------- */

.feed {
  border-left: 1px solid var(--border);
  background: #0a0c0f;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.feed-header h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.feed-status {
  font-size: 11.5px;
  color: var(--text-dim);
  transition: color 0.3s var(--ease-out);
}
.feed-status.live { color: var(--accent); }

.feed-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  animation: feedIn 0.4s var(--ease-out) both;
}

@keyframes feedIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.feed-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.feed-kind {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.feed-kind.inbound { color: var(--accent); }
.feed-kind.outbound { color: var(--blue); }

.feed-time { font-size: 11px; color: var(--text-dim); }

.feed-body { font-size: 13.5px; }
.feed-detail { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.feed-payload {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  margin-top: 6px;
  color: var(--accent);
}

/* Feed empty state */
.feed-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  gap: 6px;
  padding-bottom: 40px;
}

.feed-empty-phone {
  width: 72px;
  height: 120px;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 10px 8px;
  margin-bottom: 14px;
  animation: float 3s ease-in-out infinite;
}

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

.feed-empty-screen {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.feed-empty-bubble {
  width: 42px;
  height: 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.feed-empty-bubble.short { width: 28px; align-self: flex-end; background: var(--accent-dim); border-color: rgba(61,220,132,0.2); }

.feed-empty p { font-size: 13.5px; }
.feed-empty-hint { font-size: 12px; max-width: 200px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .feed {
    position: static;
    height: auto;
    min-height: 320px;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 32px;
  }
  .main { padding: 32px 20px 48px; }
  .header h1 { font-size: 34px; }
}
