:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-soft: #1a1a1f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f5;
  --text-muted: #a0a0aa;
  --text-dim: #6b6b75;
  --accent: #d4ff3a;
  --accent-ink: #0a0a0b;
  --warm: #ff8a5b;
  --cool: #7dd3fc;
  --success: #4ade80;
  --danger: #f87171;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow-xl: 0 40px 80px -30px rgba(0, 0, 0, 0.75), 0 16px 40px -16px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-elev: #fffdf8;
  --bg-soft: #ffffff;
  --surface: rgba(10, 10, 11, 0.025);
  --surface-2: rgba(10, 10, 11, 0.05);
  --border: rgba(10, 10, 11, 0.08);
  --border-strong: rgba(10, 10, 11, 0.18);
  --text: #0a0a0b;
  --text-muted: #4a4a52;
  --text-dim: #6b6b75;
  --accent: #1a1a1f;
  --accent-ink: #d4ff3a;
  --warm: #d97757;
  --cool: #1d4ed8;
  --shadow-xl: 0 30px 60px -25px rgba(10, 10, 11, 0.18), 0 10px 30px -10px rgba(10, 10, 11, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body { min-height: 100vh; overflow-x: hidden; }

a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
[data-theme="light"] a:hover { color: var(--warm); }

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Grain & mesh background */
.grain {
  position: fixed;
  inset: -100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
[data-theme="light"] .grain { opacity: 0.4; }

.mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
}
.blob-a {
  width: 520px; height: 520px;
  background: var(--accent);
  top: -140px; left: -80px;
  animation: drift1 28s ease-in-out infinite alternate;
}
.blob-b {
  width: 460px; height: 460px;
  background: var(--warm);
  top: 30%; right: -120px;
  opacity: 0.35;
  animation: drift2 32s ease-in-out infinite alternate;
}
.blob-c {
  width: 480px; height: 480px;
  background: var(--cool);
  bottom: -160px; left: 35%;
  opacity: 0.3;
  animation: drift3 36s ease-in-out infinite alternate;
}
[data-theme="light"] .blob { opacity: 0.5; filter: blur(140px); }
[data-theme="light"] .blob-a { opacity: 0.25; }

@keyframes drift1 { 0% { transform: translate(0,0); } 100% { transform: translate(80px, 60px); } }
@keyframes drift2 { 0% { transform: translate(0,0); } 100% { transform: translate(-60px, -40px); } }
@keyframes drift3 { 0% { transform: translate(0,0); } 100% { transform: translate(40px, -80px); } }

/* Ticker */
.ticker {
  position: relative;
  z-index: 2;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  padding: 8px 0;
  animation: marquee 90s linear infinite;
  gap: 0;
}
.ticker-item {
  padding: 0 22px;
  border-right: 1px solid rgba(0,0,0,0.18);
}
.ticker-item .t-code { font-weight: 700; }
.ticker-item .t-val { opacity: 0.85; margin-left: 6px; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 18px;
}
.brand-mark.small { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: -2px;
  margin-top: 8px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 0 var(--text-dim);
}
.status-chip.live .status-dot {
  background: var(--success);
  animation: status-pulse 2.2s ease-in-out infinite;
}
.status-chip.error .status-dot { background: var(--danger); }
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  padding: 80px 0 60px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.eye-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
}

.display {
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 24px 0 24px;
}
.display em {
  font-size: 1.05em;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent) 0%, var(--warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .display em {
  background: linear-gradient(120deg, var(--warm) 0%, var(--cool) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.display-md {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.0;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 12px 0;
}
.display-md em {
  font-size: 1.05em;
  background: linear-gradient(120deg, var(--accent) 0%, var(--warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .display-md em {
  background: linear-gradient(120deg, var(--warm) 0%, var(--cool) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 40px;
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.stat-num .symbol { color: var(--accent); }
[data-theme="light"] .stat-num .symbol { color: var(--warm); }
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 8px;
  font-weight: 500;
}

/* Converter card */
.converter-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
  transform-style: preserve-3d;
  will-change: transform;
}
.card-shimmer {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(212, 255, 58, 0.08), transparent 40%, transparent 60%, rgba(255, 138, 91, 0.06) 100%);
  opacity: 0.8;
}
[data-theme="light"] .card-shimmer {
  background: linear-gradient(135deg, rgba(217, 119, 87, 0.06), transparent 50%, rgba(125, 211, 252, 0.06) 100%);
}

.card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.card-head h2 {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
[data-theme="light"] .kicker { color: var(--warm); }

.updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.field { position: relative; display: block; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.amount-field { margin-bottom: 18px; }
.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.amount-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.amount-input-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 18px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.amount-input-wrap input::-webkit-outer-spin-button,
.amount-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-currency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding-right: 18px;
  white-space: nowrap;
}

.swap-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  margin-bottom: 24px;
}

.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 38px 14px 16px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.select-wrap select:focus {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.chev {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap.small select { padding: 10px 32px 10px 14px; font-size: 13.5px; border-radius: 10px; }
.select-wrap.small .chev { right: 12px; }

.swap-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(.5, 1.6, .4, 1);
}
.swap-btn:hover { transform: rotate(180deg) scale(1.05); }
.swap-btn svg { width: 18px; height: 18px; }

.result {
  position: relative;
  margin-top: 4px;
  padding: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 18px;
  overflow: hidden;
}
.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 0;
  color: var(--accent-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.copy-btn:hover { background: rgba(0, 0, 0, 0.22); transform: translateY(-1px); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn .check-i { display: none; }
.copy-btn.copied { background: rgba(0, 0, 0, 0.85); color: var(--accent); }
.copy-btn.copied .copy-i { display: none; }
.copy-btn.copied .check-i { display: block; }
.result::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 6px;
}
.result-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
#result-amount {
  font-family: 'Inter', sans-serif;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}
.result-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.65;
}
.result-sub {
  margin-top: 8px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.7;
}

.also-wrap {
  margin-top: 20px;
}
.also-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.also-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.also-card {
  position: relative;
  padding: 12px 12px 12px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.also-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--bg-soft);
}
.also-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.also-flag {
  font-size: 14px;
  line-height: 1;
}
.also-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.also-val {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.quick-chip {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: 96px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-head .muted { margin: 8px 0 0; font-size: 15px; }

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }

.base-picker {
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

/* Rates toolbar */
.rates-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}
.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 12px 40px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input:focus {
  border-color: var(--accent);
  background: var(--bg-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.filter-tab {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 7px 13px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.rates-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 18px;
}

/* Range tabs */
.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
}
.range-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.range-tab:hover { color: var(--text); }
.range-tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}
.range-tab[disabled] { opacity: 0.5; cursor: wait; }

/* Rates grid */
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.rate-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), border-color 0.25s, background 0.25s, opacity 0.25s;
  overflow: hidden;
  opacity: 0;
  animation: rate-pop 0.5s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes rate-pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.rate-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.rate-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.rate-card:hover::after { opacity: 1; }

.rate-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.rate-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, transform 0.2s, background 0.2s;
  z-index: 2;
}
.rate-card:hover .rate-fav { opacity: 1; }
.rate-fav.is-active {
  opacity: 1;
  color: var(--accent);
}
[data-theme="light"] .rate-fav.is-active { color: var(--warm); }
.rate-fav:hover {
  background: var(--surface-2);
  transform: scale(1.1);
}
.rate-fav svg { width: 14px; height: 14px; }
.rate-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.rate-flag {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  overflow: hidden;
}
.rate-flag.is-symbol {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-size: 12px;
}
.rate-name {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rate-value {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}
.rate-base {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

.skeleton-card {
  height: 130px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border: 1px solid var(--border);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Chart */
.chart-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-xl);
}
.chart-meta {
  display: flex;
  gap: 48px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.meta-block { min-width: 0; }
.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.chart-now {
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}
.chart-change {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.chart-change.up { color: var(--success); }
.chart-change.down { color: var(--danger); }
.chart-range {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.arrow { color: var(--text-dim); font-weight: 700; font-size: 16px; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 300px;
}
#chartSvg {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-tooltip {
  position: absolute;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  z-index: 5;
}
.chart-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text);
}

/* About / features */
.about-head { margin-bottom: 48px; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.feature {
  position: relative;
  padding: 36px 28px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.feature:hover { background: var(--surface); }
.feature:hover .feature-num { color: var(--accent); transform: translateY(-3px); }
.feature-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 28px;
  transition: color 0.3s, transform 0.3s;
}
.feature h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* CTA */
.cta {
  position: relative;
  z-index: 1;
  padding: 80px 0 100px;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 64px 56px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.cta-inner h2 { margin: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  border-radius: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -16px var(--accent);
  color: var(--accent-ink);
}

/* Legal & content pages (privacy, terms, about) */
.legal-page {
  position: relative;
  z-index: 1;
  padding: 80px 0 120px;
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
}
.legal-page h1 {
  margin: 18px 0 4px;
  line-height: 1.05;
}
.legal-page h2 {
  margin: 48px 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.legal-page p {
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 16.5px;
  line-height: 1.7;
}
.legal-page p.lead {
  font-size: 20px;
  color: var(--text);
  margin-top: 22px;
}
.legal-page ul {
  margin: 14px 0;
  padding-left: 22px;
  color: var(--text-muted);
}
.legal-page li {
  margin: 8px 0;
  line-height: 1.7;
  font-size: 16.5px;
}
.legal-page strong { color: var(--text); }
.legal-page a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.2s, border-color 0.2s;
}
.legal-page a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.updated-line {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0 0 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
@media (max-width: 640px) {
  .legal-page { padding: 48px 0 80px; }
  .legal-page p, .legal-page li { font-size: 15.5px; }
  .legal-page p.lead { font-size: 17px; }
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}
.footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.footer-nav a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(.2, .8, .2, 1), transform 0.9s cubic-bezier(.2, .8, .2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .nav { display: none; }
  .section { padding: 72px 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .header-inner { padding: 14px 18px; gap: 12px; }
  .header-right .status-chip { display: none; }
  .hero { padding: 48px 0 32px; }
  .converter-card { padding: 24px; }
  .amount-input-wrap input { font-size: 26px; padding: 14px; }
  #result-amount { font-size: 34px; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 28px; }
  .chart-card { padding: 22px; }
  .chart-meta { gap: 24px; }
  .swap-row { grid-template-columns: 1fr; }
  .swap-btn { width: 100%; height: 44px; transform: rotate(90deg); margin: 0; }
  .swap-btn:hover { transform: rotate(270deg); }
  .cta-inner { padding: 40px 28px; }
  .also-grid { grid-template-columns: repeat(2, 1fr); }
  .rates-toolbar { gap: 12px; }
  .search-wrap { max-width: none; min-width: 0; }
  .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .range-tabs { width: 100%; justify-content: stretch; }
  .range-tabs .range-tab { flex: 1; padding: 10px 8px; text-align: center; }
}
