@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   VERSO — Design System
   Aesthetic: Dark editorial. Ink and candlelight.
   ============================================================ */

:root {
  --ink: #0d0d0f;
  --ink-2: #141418;
  --ink-3: #1c1c22;
  --ink-4: #252530;
  --paper: #f5f0e8;
  --paper-dim: #c8c0b0;
  --paper-ghost: #6b6560;
  --gold: #c9a84c;
  --gold-dim: #8a6f2e;
  --gold-glow: rgba(201, 168, 76, 0.12);
  --red: #c0392b;
  --green: #2ecc71;
  --border: rgba(245, 240, 232, 0.08);
  --border-warm: rgba(201, 168, 76, 0.2);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;

  --transition: 200ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.02em;
}

.gold { color: var(--gold); }
.dim { color: var(--paper-ghost); }
.paper { color: var(--paper); }
.italic { font-style: italic; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   COMPONENTS — BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gold);
  color: var(--ink);
}

.btn--primary:hover {
  background: #d4b660;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--paper-dim);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--border-warm);
  color: var(--paper);
}

.btn--danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(192, 57, 43, 0.3);
}

.btn--danger:hover {
  background: rgba(192, 57, 43, 0.1);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   COMPONENTS — INPUTS
   ============================================================ */

.input {
  width: 100%;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  padding: 12px 16px;
  transition: border-color var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--gold-dim);
}

.input::placeholder {
  color: var(--paper-ghost);
}

.input--mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.7;
}

.label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-ghost);
  margin-bottom: 8px;
}

.field {
  margin-bottom: 20px;
}

/* ============================================================
   COMPONENTS — CARDS
   ============================================================ */

.card {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card--warm {
  border-color: var(--border-warm);
  background: linear-gradient(135deg, var(--ink-2), var(--ink-3));
}

/* ============================================================
   COMPONENTS — IDENTITY BADGE
   ============================================================ */

.identity-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-warm);
  flex-shrink: 0;
  overflow: hidden;
}

.identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--paper);
  line-height: 1.2;
}

.identity-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper-ghost);
  margin-top: 2px;
}

/* ============================================================
   COMPONENTS — PLATFORM CHIPS
   ============================================================ */

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.platform-chip:hover {
  border-color: var(--border-warm);
}

.platform-chip.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.platform-chip.connected {
  opacity: 1;
}

.platform-chip.disconnected {
  opacity: 0.5;
}

.platform-chip input[type="checkbox"] {
  display: none;
}

.platform-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.platform-name {
  font-size: 0.88rem;
  font-weight: 500;
}

.platform-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--paper-ghost);
}

.platform-chip.selected .platform-status {
  color: var(--gold);
}

/* ============================================================
   COMPONENTS — DIVIDER
   ============================================================ */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.divider--label {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--paper-ghost);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 28px 0;
}

.divider--label::before,
.divider--label::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ============================================================
   COMPONENTS — NOTICE / TOAST
   ============================================================ */

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
}

.notice--info {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--paper-dim);
}

.notice--success {
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.2);
  color: var(--paper-dim);
}

.notice-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeUp {
  animation: fadeUp 0.5s ease both;
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease both;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ============================================================
   UTILITY
   ============================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink-2); }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--paper-ghost); }

/* ============================================================
   LOADING SKELETON
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, var(--ink-3) 25%, var(--ink-4) 50%, var(--ink-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
