@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&display=swap");

:root {
  --ink: #171717;
  --muted: #727477;
  --gold: #f3b72e;
  --gold-dark: #c98914;
  --red: #d83b32;
  --cream: #fff9eb;
  --paper: #fffdf8;
  --line: rgba(23, 23, 23, 0.1);
  --shadow: 0 26px 70px rgba(120, 78, 18, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(243, 183, 46, 0.2), transparent 25%),
    radial-gradient(circle at 92% 16%, rgba(216, 59, 50, 0.1), transparent 22%),
    linear-gradient(135deg, #fffdf7 0%, #fff8e9 52%, #fff4df 100%);
  color: var(--ink);
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.swap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1220px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
}

.swap-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.14rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-accent {
  color: var(--red);
}

.swap-brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  overflow: hidden;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: #151515;
  box-shadow: 0 7px 0 rgba(201, 137, 20, 0.2);
}

.swap-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swap-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.swap-nav a {
  padding: 8px 0;
}

.swap-nav a:hover,
.swap-nav .active {
  color: var(--ink);
}

.swap-nav .active {
  border-bottom: 2px solid var(--red);
}

.swap-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.swap-menu-toggle span {
  display: block;
  height: 3px;
  margin: 4px 0;
  border-radius: 99px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.swap-nav.menu-open + .swap-menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.swap-nav.menu-open + .swap-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.swap-nav.menu-open + .swap-menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.connect-button,
.swap-action {
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), #ef6a37);
  box-shadow: 0 12px 25px rgba(216, 59, 50, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.connect-button {
  padding: 0.82rem 1.2rem;
  font-size: 0.82rem;
}

.connect-button:hover,
.swap-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(216, 59, 50, 0.3);
}

.swap-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 68px 0 30px;
}

.swap-intro {
  max-width: 620px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow,
.card-kicker,
.side-label {
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.swap-intro h1 {
  margin-top: 13px;
  font-weight: 900;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
}

.swap-intro h1 span {
  color: var(--red);
}

.swap-intro p {
  max-width: 480px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.swap-layout {
  display: grid;
  grid-template-columns: minmax(0, 530px) minmax(280px, 1fr);
  align-items: center;
  gap: 40px;
  max-width: 940px;
  margin: 0 auto;
}

.swap-card {
  position: relative;
  padding: 29px;
  border: 1px solid rgba(23, 23, 23, 0.09);
  border-radius: 29px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
}

.card-heading h2 {
  margin-top: 5px;
  font-weight: 900;
  font-size: 1.65rem;
  letter-spacing: 0.01em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.icon-button:hover {
  transform: rotate(25deg);
}

.token-field {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--cream);
}

.receive-field {
  background: #fff8f7;
}

.field-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.field-topline strong {
  color: var(--ink);
}

.amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.amount-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 800;
}

.amount-row input::placeholder {
  color: #b0a99d;
}

.amount-row input::-webkit-outer-spin-button,
.amount-row input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.token-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 9px 7px 7px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.token-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 900;
}

.token-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sol-icon {
  background: linear-gradient(135deg, #9a62ff, #19c7c8);
  color: #ffffff;
}

.chevron {
  color: var(--muted);
  font-size: 1rem;
}

.quick-values {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.quick-values button {
  padding: 5px 9px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.quick-values button:hover {
  border-color: var(--gold-dark);
  color: var(--ink);
}

.switch-button {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -8px auto;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.25s ease, background 0.2s ease;
}

.switch-button:hover {
  transform: rotate(180deg);
  background: var(--red);
}

.swap-details {
  display: grid;
  gap: 11px;
  margin: 22px 2px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.swap-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.swap-details strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.swap-details .positive {
  color: #2b9b6b;
}

.swap-action {
  width: 100%;
  padding: 1.1rem;
  font-size: 0.95rem;
}

.mock-note {
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
  text-align: center;
}

.token-modal[hidden] {
  display: none;
}

.token-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.token-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.45);
  backdrop-filter: blur(4px);
}

.token-dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: min(620px, 90vh);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.token-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.token-dialog-heading h2 {
  font-size: 1.35rem;
}

.token-search-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.7rem;
}

.token-search {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: none;
}

.token-search:focus {
  border-color: var(--gold-dark);
}

.token-search-status {
  margin: 13px 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: none;
}

.token-results {
  display: grid;
  gap: 6px;
}

.token-result {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-transform: none;
}

.token-result:hover {
  border-color: var(--line);
  background: var(--cream);
}

.token-result strong {
  font-size: 0.9rem;
}

.token-result span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swap-side-panel {
  padding: 10px 20px 10px 6px;
}

.side-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 174px;
  height: 174px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: #181818;
  box-shadow: 14px 15px 0 rgba(243, 183, 46, 0.28);
  transform: rotate(-5deg);
}

.side-art::after {
  position: absolute;
  right: -16px;
  bottom: 15px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.side-art img {
  width: 142px;
  height: 142px;
  border: 5px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
}

.art-ring {
  position: absolute;
  inset: -13px;
  border: 1px dashed rgba(216, 59, 50, 0.45);
  border-radius: 50%;
}

.swap-side-panel h2 {
  max-width: 360px;
  margin-top: 9px;
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
}

.swap-side-panel > p {
  max-width: 360px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.side-stats {
  display: flex;
  gap: 30px;
  margin-top: 26px;
}

.side-stats div {
  display: grid;
  gap: 3px;
}

.side-stats strong {
  font-size: 1.25rem;
}

.side-stats span {
  color: var(--muted);
  font-size: 0.7rem;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 940px;
  margin: 68px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.trust-row > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #ffffff;
  color: var(--red);
  box-shadow: 0 6px 15px rgba(120, 78, 18, 0.1);
  font-size: 1.1rem;
}

.trust-row span:last-child {
  display: grid;
  gap: 2px;
}

.trust-row strong {
  font-size: 0.78rem;
}

.trust-row small {
  color: var(--muted);
  font-size: 0.67rem;
}

.swap-footer {
  padding: 25px 20px 30px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

@media (max-width: 820px) {
  .swap-layout {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .swap-side-panel {
    padding: 20px 4px 0;
    text-align: center;
  }

  .side-art {
    margin-right: auto;
    margin-left: auto;
  }

  .swap-side-panel > p {
    margin-right: auto;
    margin-left: auto;
  }

  .side-stats {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .swap-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    width: min(100% - 28px, 520px);
    min-height: 70px;
  }

  .swap-brand {
    min-width: 0;
    gap: 7px;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
  }

  .swap-brand-mark {
    width: 36px;
    height: 36px;
    border-width: 2px;
  }

  .swap-nav {
    display: none;
  }

  .swap-menu-toggle {
    display: block;
    margin-left: auto;
  }

  .swap-nav.menu-open {
    position: absolute;
    top: calc(100% - 2px);
    right: 14px;
    left: 14px;
    z-index: 10;
    display: grid;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .swap-nav.menu-open a {
    padding: 12px;
    border-radius: 9px;
  }

  .swap-nav.menu-open a:hover,
  .swap-nav.menu-open a:focus-visible {
    background: var(--cream);
  }

  .connect-button {
    white-space: nowrap;
    padding: 0.7rem 0.85rem;
    font-size: 0.72rem;
  }

  .swap-page {
    width: min(100% - 28px, 520px);
    padding-top: 48px;
  }

  .swap-intro {
    width: 100%;
    max-width: none;
    padding: 0 4px;
    margin-bottom: 34px;
  }

  .swap-intro .eyebrow {
    display: block;
    width: 100%;
    padding-left: 0.12em;
    text-align: center;
  }

  .swap-intro h1 {
    font-size: clamp(2.35rem, 12vw, 4rem);
    line-height: 0.98;
  }

  .swap-intro p {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .swap-card {
    width: 100%;
    padding: 22px 16px;
    border-radius: 24px;
  }

  .field-topline,
  .swap-details div {
    font-size: 0.7rem;
  }

  .amount-row {
    gap: 8px;
  }

  .amount-row input {
    font-size: 1.35rem;
  }

  .token-select {
    font-size: 0.74rem;
  }

  .token-select {
    gap: 5px;
    padding-right: 7px;
  }

  .trust-row {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 48px;
  }
}
