:root {
  --bg: #07090d;
  --panel: #111820;
  --panel-2: #16212b;
  --text: #f7fafc;
  --muted: #aab6c3;
  --line: rgba(255, 255, 255, 0.12);
  --gold: #f3c96b;
  --teal: #42d4c8;
  --green: #41d98a;
  --red: #ff6370;
  --ink: #0b1117;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --hero-shift: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(7, 9, 13, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  animation: headerLaunch 620ms ease-out both;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.site-header.scrolled {
  background: rgba(7, 9, 13, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 18px rgba(66, 212, 200, 0.42);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(243, 201, 107, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 70% 25%, rgba(66, 212, 200, 0.45), transparent 28%),
    linear-gradient(135deg, rgba(243, 201, 107, 0.18), rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 24px rgba(243, 201, 107, 0.25);
  animation: markWake 900ms ease-out 220ms both;
}

.brand-mark svg {
  width: 30px;
  fill: var(--gold);
}

.brand strong,
h1,
h2,
h3 {
  font-family: "Segoe UI Display", "Segoe UI", Inter, system-ui, sans-serif;
}

.brand strong {
  display: block;
  font-size: 1.06rem;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px);
  color: #d8e1e9;
  font-size: 0.93rem;
}

.main-nav a:hover {
  color: var(--gold);
}

.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--gold), #ffe8a4 52%, #7be2d9);
  background-size: 180% 100%;
  color: #10151c;
  box-shadow: 0 18px 42px rgba(243, 201, 107, 0.22);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  box-shadow: 0 20px 52px rgba(66, 212, 200, 0.18), 0 18px 42px rgba(243, 201, 107, 0.2);
}

.primary-button.small {
  min-height: 40px;
}

.primary-button.full {
  width: 100%;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

.hero {
  position: relative;
  min-height: 760px;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.58) saturate(0.62) contrast(1.06);
  transform: translate3d(0, calc(var(--hero-shift) * 1px), 0) scale(1.04);
  transform-origin: center;
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(7, 9, 13, 0.98) 0%, rgba(7, 9, 13, 0.9) 40%, rgba(7, 9, 13, 0.52) 74%),
    linear-gradient(0deg, var(--bg) 0%, rgba(7, 9, 13, 0.24) 34%);
}

.hero-content {
  position: relative;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 170px 0 70px;
}

.trust-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(66, 212, 200, 0.32);
  border-radius: 999px;
  background: rgba(66, 212, 200, 0.08);
  color: #dffefb;
  font-size: 0.88rem;
  font-weight: 700;
  animation: launchUp 760ms cubic-bezier(0.16, 1, 0.3, 1) 140ms both;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(65, 217, 138, 0.13);
}

h1 {
  max-width: 720px;
  margin: 22px 0 10px;
  font-size: clamp(4.3rem, 11vw, 9.6rem);
  line-height: 0.9;
  letter-spacing: 0;
  animation: launchUp 820ms cubic-bezier(0.16, 1, 0.3, 1) 240ms both;
}

.hero p {
  max-width: 660px;
  margin: 0 0 28px;
  color: #d5dee7;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  animation: launchUp 820ms cubic-bezier(0.16, 1, 0.3, 1) 340ms both;
}

.hero-actions {
  animation: launchUp 820ms cubic-bezier(0.16, 1, 0.3, 1) 430ms both;
}

.auth-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 560px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(11, 17, 23, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.home-auth {
  margin-top: 24px;
  animation: launchUp 860ms cubic-bezier(0.16, 1, 0.3, 1) 520ms both;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.active {
  display: grid;
}

.auth-ready {
  display: none;
  gap: 12px;
}

.auth-ready strong {
  font-size: 1.05rem;
}

.is-authenticated .header-actions [data-open-auth],
.is-authenticated .auth-panel .auth-tabs,
.is-authenticated .auth-panel .auth-form {
  display: none;
}

.is-authenticated .auth-panel .auth-ready {
  display: grid;
}

.auth-card .auth-panel,
.modal-card.auth-card {
  width: 100%;
}

.ticker-tape {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
  max-width: 860px;
  margin-top: 34px;
  animation: launchUp 860ms cubic-bezier(0.16, 1, 0.3, 1) 620ms both;
}

.ticker-tape span {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.065);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ticker-tape span:hover,
.market-card:hover,
.checkout-preview:hover,
.feature-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(66, 212, 200, 0.36);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045));
}

.ticker-tape b {
  font-size: 1.04rem;
}

.ticker-tape em,
.market-card em,
.pair em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.market-band,
.trading-section,
.payments-section,
.security-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 76px 0;
}

.section-heading {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.section-heading.left {
  justify-items: start;
  text-align: left;
}

.section-heading span,
.modal-kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.market-card,
.trading-shell,
.checkout-preview,
.feature-grid article,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
}

.market-card {
  padding: 18px;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.market-card.active {
  border-color: rgba(243, 201, 107, 0.7);
}

.market-card div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-card p {
  margin: 22px 0 0;
  font-size: 1.45rem;
  font-weight: 900;
}

.coin {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.btc {
  background: var(--gold);
}

.eth {
  background: #92a3ff;
}

.sol {
  background: var(--teal);
}

.usdc {
  background: #72b7ff;
}

.trading-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 300px;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.asset-list,
.chart-panel,
.order-panel {
  background: rgba(10, 15, 21, 0.96);
}

.asset-list {
  display: grid;
  align-content: start;
}

.pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.pair.active {
  background: rgba(243, 201, 107, 0.1);
}

.pair b {
  color: #dfe8ef;
}

.chart-panel {
  min-width: 0;
  padding: 20px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.chart-toolbar strong {
  display: block;
  font-size: 1.35rem;
}

.chart-toolbar span {
  color: var(--muted);
  font-size: 0.9rem;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.segmented button,
.buy-sell-toggle button {
  min-width: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segmented button {
  height: 34px;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

canvas {
  width: 100%;
  height: 380px;
}

.order-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.buy-sell-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.buy-sell-toggle button {
  height: 42px;
}

.buy-sell-toggle button.active[data-side="buy"] {
  background: rgba(65, 217, 138, 0.18);
  color: var(--green);
}

.buy-sell-toggle button.active[data-side="sell"] {
  background: rgba(255, 99, 112, 0.16);
  color: var(--red);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c1218;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(66, 212, 200, 0.75);
}

.fee-row,
.receipt-row,
.modal-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.fee-row b,
.receipt-row b,
.modal-summary b {
  color: var(--text);
}

.fine-print {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.payments-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 46px;
  align-items: center;
}

.payment-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.payment-methods span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
}

.checkout-preview {
  display: grid;
  gap: 16px;
  padding: 22px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header strong {
  color: var(--gold);
  font-size: 1.7rem;
}

.receipt-row.total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature-grid article {
  padding: 20px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.feature-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(66, 212, 200, 0.12);
  color: var(--teal);
  font-weight: 900;
}

.feature-grid h3 {
  margin: 18px 0 8px;
  font-size: 1.15rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer div {
  display: flex;
  gap: 18px;
}

.brand.compact .brand-mark {
  width: 36px;
  height: 36px;
}

.brand.compact svg {
  width: 24px;
}

.modal {
  width: min(530px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(7px);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 26px;
  background: #0e151c;
}

.modal-card h2 {
  font-size: 2rem;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.modal-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 720ms cubic-bezier(0.16, 1, 0.3, 1), transform 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal.stagger-1 {
  transition-delay: 80ms;
}

.reveal.stagger-2 {
  transition-delay: 160ms;
}

.reveal.stagger-3 {
  transition-delay: 240ms;
}

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

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

@keyframes markWake {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .main-nav,
  .header-actions {
    display: none;
  }

  .site-header.open .main-nav,
  .site-header.open .header-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .menu-button {
    display: block;
    justify-self: end;
  }

  .ticker-tape,
  .markets-grid,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trading-shell {
    grid-template-columns: 1fr;
  }

  .asset-list {
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    overflow-x: auto;
  }

  .pair {
    border-right: 1px solid var(--line);
  }

  .payments-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 900px;
  }

  .hero-content {
    width: min(100% - 28px, 1180px);
    padding-bottom: 42px;
  }

  .hero-actions,
  .header-actions,
  .site-footer,
  .site-footer div {
    align-items: stretch;
    flex-direction: column;
  }

  .ticker-tape,
  .markets-grid,
  .feature-grid,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  canvas {
    height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .hero-media img {
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
