/* ============================================
   Xchange — design tokens
   Palette: deep navy-black surface, periwinkle
   accent (not the default green/red fintech duo),
   emerald/coral reserved for up/down states only.
   Type: Sora (display) + Inter (body) + JetBrains
   Mono (tabular numerals — the exchange-board cue).
   ============================================ */

:root {
  --bg: #0b0e14;
  --bg-glow: radial-gradient(circle at 15% 0%, rgba(108, 142, 255, 0.14), transparent 45%),
             radial-gradient(circle at 85% 100%, rgba(52, 211, 153, 0.10), transparent 40%);
  --surface: #12151d;
  --surface-raised: #171b26;
  --border: #232837;
  --border-soft: #1b1f2b;

  --text: #e9ebf1;
  --text-muted: #9096a8;
  --text-faint: #5c6377;

  --accent: #6c8eff;
  --accent-soft: rgba(108, 142, 255, 0.14);
  --accent-strong: #8aa5ff;

  --up: #34d399;
  --up-soft: rgba(52, 211, 153, 0.12);
  --down: #f87171;
  --down-soft: rgba(248, 113, 113, 0.12);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  font-size: 20px;
  color: var(--accent);
  display: inline-block;
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.github-icon {
  display: block;
  transition: fill 0.2s ease;
  color: var(--text-muted);
}

.link-item:hover .github-icon {
  color: var(--accent);
}

/* ---------- hero ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 60px;
}

.hero {
  max-width: 640px;
  text-align: center;
  margin: 28px 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- ticker (signature element) ---------- */

.ticker {
  width: 100%;
  max-width: 640px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 22px;
  scrollbar-width: none;
}

.ticker::-webkit-scrollbar { display: none; }

.ticker-item {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 13px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.ticker-item .pair {
  color: var(--text-muted);
}

.ticker-item .rate {
  color: var(--text);
  font-weight: 500;
}

/* ---------- converter card ---------- */

.converter-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.amount-row {
  margin-bottom: 16px;
}

#amount {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 14px 16px;
  width: 100%;
  transition: border-color 0.2s ease;
}

#amount:focus {
  outline: none;
  border-color: var(--accent);
}

#amount::placeholder {
  color: var(--text-faint);
}

.pairs-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

select {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 12px 10px;
  width: 100%;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

#swap {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

#swap:hover {
  background: var(--accent);
  color: #0b0e14;
  border-color: var(--accent);
}

#swap:active {
  transform: rotate(180deg);
}

#swap:focus-visible,
#convert:focus-visible,
select:focus-visible,
#amount:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- quick pairs ---------- */

.quick-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-pair-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-pair-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ---------- convert button ---------- */

#convert {
  width: 100%;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #0b0e14;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#convert:hover {
  background: var(--accent-strong);
}

#convert:active {
  transform: scale(0.98);
}

#convert.loading {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- result ---------- */

.result-empty {
  margin-top: 18px;
  padding: 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.result-box {
  margin-top: 18px;
  padding: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.result-main {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.copy-btn {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.result-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0;
}

.result-updated {
  font-size: 11px;
  color: var(--text-faint);
  margin: 10px 0 0;
}

.error-text {
  color: var(--down);
}

/* ---------- insights ---------- */

.insights {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(108, 142, 255, 0.25);
  border-radius: var(--radius-md);
}

.insights-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  margin-bottom: 6px;
}

.insights .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.insights p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

/* ---------- disclaimer / footer ---------- */

.disclaimer {
  max-width: 440px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 18px;
  line-height: 1.5;
}

.site-footer {
  text-align: center;
  padding: 22px;
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-strong);
}

/* ---------- about page ---------- */

.about-main {
  align-items: center;
}

.about-card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
}

.about-card p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

.about-card strong {
  color: var(--text);
}

.about-card a {
  color: var(--accent-strong);
  text-decoration: none;
}

.about-card a:hover {
  text-decoration: underline;
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  .site-header { padding: 18px 20px; }
  .hero h1 { font-size: 25px; }
  .converter-card { padding: 22px 18px; }
  #amount { font-size: 22px; }
}
