:root {
  --sand: #f0ece8;
  --paper: #efece7;
  --aurum: #e3dcd4;
  --aurum-light: #ebe6e0;
  --aurum-hover: #dbd6d0;
  --onyx: #131313;
  --slate: #2c3b43;
  --graphite: #5e6e7c;
  --maple: #731416;
  --green: #086d52;
  --divider: #c8cccd;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--sand);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--onyx);
  background: var(--sand);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

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

.autara-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  border-bottom: 1px solid var(--divider);
  background: rgba(240, 236, 232, 0.82);
  backdrop-filter: blur(42px);
}

.autara-nav {
  display: flex;
  width: 100%;
  min-height: 73px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.autara-logo-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.autara-logo-mobile {
  display: block;
  width: 36px;
  height: 36px;
}

.autara-logo-desktop {
  display: none;
  width: 50px;
  height: 50px;
}

.snow-brand-mark {
  background: var(--slate);
  -webkit-mask: url("snowflake-logo-tight.svg") center / contain no-repeat;
  mask: url("snowflake-logo-tight.svg") center / contain no-repeat;
}

.testnet-pill {
  width: 60px;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 24px;
}

.desktop-nav a,
.desktop-nav button {
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--graphite);
  background: transparent;
  font-weight: 500;
}

.desktop-nav .is-active {
  color: var(--onyx);
  background: var(--aurum);
}

.more-wrap {
  position: relative;
}

.more-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  width: 224px;
  padding: 8px 4px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.more-wrap:hover .more-menu,
.more-wrap:focus-within .more-menu {
  display: grid;
}

.more-menu a,
.more-menu span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--graphite);
  font-weight: 500;
}

.more-menu a:hover {
  color: var(--onyx);
  background: var(--aurum);
}

.more-menu .coming-soon {
  cursor: not-allowed;
}

.connect-wallet {
  flex-shrink: 0;
  min-height: 42px;
  margin-left: auto;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--graphite);
  background: transparent;
  font-weight: 500;
}

.autara-main {
  min-height: 100vh;
  padding: 105px 0 140px;
}

.autara-container {
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 16px;
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin: 8px 0 48px;
}

.market-hero h1 {
  margin: 0;
  color: var(--onyx);
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.market-hero-copy > p {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--graphite);
  font-size: 18px;
  line-height: 1.55;
}

.feature-list {
  display: none;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate);
  font-weight: 500;
}

.feature-icon {
  width: 20px;
  height: 20px;
  color: var(--maple);
}

.arch-card-wrap {
  display: flex;
  justify-content: flex-end;
}

.arch-border {
  width: 384px;
  padding: 0.5px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--maple), var(--graphite));
}

.arch-card {
  position: relative;
  min-height: 169px;
  overflow: hidden;
  border-radius: 15.5px;
  padding: 24px;
  background: var(--paper);
}

.arch-logo {
  position: absolute;
  right: -56px;
  bottom: -12px;
  width: 176px;
  pointer-events: none;
}

.arch-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  white-space: nowrap;
}

.arch-title svg {
  width: 20px;
  height: 20px;
}

.arch-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.arch-title span {
  border-bottom: 1px dashed var(--graphite);
}

.arch-card > p {
  position: relative;
  z-index: 1;
  max-width: 272px;
  margin: 0;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.5;
}

.markets-section {
  margin-top: 72px;
}

.markets-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.markets-summary h2 {
  margin: 0;
  color: var(--onyx);
  font-size: 24px;
  font-weight: 700;
}

.summary-values {
  display: flex;
  gap: 48px;
  text-align: right;
}

.summary-values p {
  margin: 0;
  color: var(--slate);
  font-size: 14px;
}

.summary-values strong {
  display: block;
  margin-top: 2px;
  color: var(--onyx);
  font-size: 20px;
  font-weight: 600;
}

.market-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 16px 0;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  color: var(--onyx);
  background: transparent;
  font-size: 14px;
}

.filter-item svg {
  width: 14px;
  height: 14px;
  color: var(--slate);
}

.filter-item strong {
  font-weight: 600;
}

.sort-item {
  margin-left: auto;
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.market-card {
  overflow: hidden;
  border-radius: 16px;
  background: var(--aurum);
}

.market-card-header {
  border-radius: 16px 16px 0 0;
  padding: 16px 20px;
  color: #fff;
  background: var(--slate);
}

.pair-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.pair {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-icons {
  display: flex;
}

.token-icons img {
  width: 32px;
  height: 32px;
  border: 2px solid var(--slate);
  border-radius: 50%;
}

.token-icons img + img {
  margin-left: -8px;
}

.pair-name {
  font-size: 18px;
  font-weight: 700;
}

.pair-name span {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.chevron {
  width: 20px;
  height: 20px;
}

.market-card-header p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.market-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  font-size: 14px;
}

.metric p {
  margin: 0 0 2px;
  color: var(--slate);
  font-size: 12px;
}

.metric strong {
  color: var(--onyx);
  font-size: 16px;
  font-weight: 600;
}

.metric .green {
  color: var(--green);
  font-weight: 700;
}

.market-actions {
  display: flex;
  gap: 12px;
  padding: 0 20px 16px;
}

.market-actions button {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  color: var(--graphite);
  background: transparent;
  font-weight: 500;
}

.market-curator {
  margin: 0;
  border-radius: 0 0 16px 16px;
  padding: 10px 20px;
  color: var(--slate);
  background: var(--aurum-light);
  font-size: 12px;
  letter-spacing: 0.025em;
}

.market-curator strong {
  color: var(--onyx);
  font-weight: 600;
}

.mobile-bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 200;
  border-top: 1px solid var(--divider);
  background: var(--sand);
}

.mobile-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.mobile-nav-item {
  display: flex;
  min-width: 96px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  padding: 6px 24px;
  color: var(--graphite);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.mobile-nav-item.active {
  color: var(--onyx);
}

.mobile-nav-item img {
  width: 22px;
  height: 22px;
  opacity: 0.5;
}

.mobile-nav-item.active img {
  opacity: 1;
}

.desktop-footer {
  display: none;
}

.autara-footer {
  border-top: 1px solid var(--divider);
  padding: 12px 64px;
  color: var(--graphite);
  font-size: 16px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--onyx);
}

.subpage-heading {
  margin: 8px 0 0;
}

.subpage-heading h1 {
  margin: 0;
  color: var(--onyx);
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.subpage-heading p {
  max-width: 672px;
  margin: 12px 0 0;
  color: var(--graphite);
  font-size: 18px;
}

.wallet-placeholder {
  position: relative;
  display: grid;
  width: 100%;
  height: 256px;
  margin-top: 32px;
  overflow: hidden;
  place-items: center;
  border-radius: 16px;
  background: var(--aurum);
}

.wallet-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(239, 236, 231, 0.6), transparent);
  transform: translateX(-100%);
}

.placeholder-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  text-align: center;
}

.placeholder-content p {
  margin: 0;
  color: var(--graphite);
  font-size: 14px;
}

.placeholder-connect {
  min-height: 42px;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--graphite);
  background: transparent;
  font-weight: 500;
}

.risk-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.risk-title svg {
  width: 28px;
  height: 28px;
  color: var(--maple);
}

.market-detail {
  padding-top: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  color: #6b7280;
  background: transparent;
  font-size: 14px;
}

.detail-stack {
  display: grid;
  gap: 24px;
  padding-top: 12px;
}

.detail-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-token-icons {
  display: flex;
}

.detail-token-icons img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
}

.detail-token-icons img + img {
  margin-left: -24px;
}

.detail-heading h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--onyx);
  font-size: 30px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-heading h1 span {
  color: #2c4341;
}

.detail-meta {
  display: flex;
  gap: 32px;
  font-size: 14px;
}

.detail-meta p {
  margin: 0;
  color: var(--graphite);
}

.detail-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--onyx);
  font-size: 20px;
  font-weight: 600;
}

.detail-meta .creator {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.detail-tabs button {
  min-height: 42px;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--graphite);
  background: transparent;
}

.detail-tabs .active {
  color: var(--onyx);
  background: var(--aurum);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.detail-metric {
  display: flex;
  min-height: 122px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: var(--aurum);
}

.detail-metric p {
  margin: 0 0 8px;
  color: #2c4341;
  font-size: 14px;
}

.detail-metric strong {
  color: var(--onyx);
  font-size: 24px;
  font-weight: 600;
}

.detail-metric .green {
  color: var(--green);
}

.detail-metric small {
  color: var(--graphite);
  font-size: 14px;
  font-weight: 400;
}

.detail-content {
  display: flex;
  gap: 24px;
}

.chart-card {
  min-width: 0;
  flex: 1;
  border-radius: 12px;
  padding: 24px;
  background: var(--aurum);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chart-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.chart-header p {
  margin: 0;
  color: var(--graphite);
  font-size: 14px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--graphite);
  border-radius: 8px;
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-left: 1px solid var(--graphite);
  padding: 0 14px;
  color: var(--onyx);
  background: transparent;
  font-size: 14px;
}

.segmented button:first-child {
  border-left: 0;
}

.segmented .selected {
  font-weight: 700;
}

.chart-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.chart-empty {
  display: grid;
  height: 320px;
  place-items: center;
  color: var(--graphite);
  font-size: 14px;
}

.chart-updated {
  color: var(--graphite);
  font-size: 12px;
  text-align: right;
}

.action-card {
  width: 100%;
  max-width: 448px;
  border-radius: 16px;
  padding: 24px;
  color: var(--paper);
  background: var(--slate);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.action-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-tabs button {
  min-height: 48px;
  border: 1px solid var(--paper);
  border-radius: 8px;
  color: var(--paper);
  background: transparent;
  font-weight: 700;
}

.action-tabs .selected {
  color: var(--onyx);
  background: var(--aurum);
}

.action-section {
  padding-top: 18px;
}

.action-section + .action-section {
  margin-top: 16px;
  border-top: 1px solid rgba(239, 236, 231, 0.12);
}

.action-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.action-label-row h3 {
  margin: 0;
  font-size: 18px;
}

.action-balance {
  color: rgba(239, 236, 231, 0.58);
  font-size: 14px;
}

.portion-buttons {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
}

.portion-buttons button {
  border: 1px solid rgba(239, 236, 231, 0.45);
  border-radius: 6px;
  padding: 2px 9px;
  color: rgba(239, 236, 231, 0.68);
  background: transparent;
}

.token-input {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  padding: 0 22px;
  color: var(--onyx);
  background: var(--sand);
}

.token-input span:first-child {
  color: #afb4bc;
  font-size: 32px;
  font-weight: 600;
}

.token-input strong {
  font-size: 30px;
}

.apy-row {
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
  font-size: 14px;
}

.action-connect {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #7f8594;
  font-size: 20px;
  font-weight: 600;
}

.creation-hero {
  margin: 16px 0 32px;
}

.creation-hero h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.creation-hero p {
  margin: 12px 0 0;
  color: var(--graphite);
  font-size: 18px;
}

.creation-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.creation-form {
  display: grid;
  width: 66.666%;
  gap: 32px;
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  background: var(--slate);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.form-section {
  display: grid;
  gap: 16px;
}

.form-section h2 {
  margin: 0;
  font-size: 20px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-size: 16px;
  font-weight: 600;
}

.form-field label span {
  color: #ff6b6b;
}

.form-field small {
  color: #d1d5db;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: 12px;
  color: var(--onyx);
  background: var(--sand);
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

.create-button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #6b7280;
  font-size: 18px;
  font-weight: 700;
}

.creation-note {
  width: 33.333%;
  border-radius: 16px;
  padding: 24px;
  background: var(--aurum);
}

.creation-note h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 500;
}

.creation-note p {
  color: var(--slate);
  line-height: 1.55;
}

.creation-note hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--divider);
}

.creation-note a {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .market-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }

  .market-hero h1 {
    font-size: 28px;
  }

  .market-hero-copy > p {
    font-size: 16px;
  }

  .arch-card-wrap {
    justify-content: stretch;
  }

  .arch-border {
    width: 100%;
  }

  .markets-section {
    margin-top: 32px;
  }

  .markets-grid {
    grid-template-columns: 1fr;
  }

  .summary-values {
    gap: 16px;
  }

  .subpage-heading h1 {
    font-size: 24px;
  }

  .subpage-heading p {
    margin-top: 8px;
    font-size: 14px;
  }

  .detail-heading h1 {
    font-size: 24px;
  }

  .detail-token-icons img {
    width: 40px;
    height: 40px;
  }

  .detail-token-icons img + img {
    margin-left: -20px;
  }

  .detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .detail-metric {
    min-height: 76px;
    align-items: flex-start;
    padding: 12px 16px;
    text-align: left;
  }

  .detail-metric p {
    margin-bottom: 4px;
    color: var(--graphite);
  }

  .detail-metric strong {
    font-size: 18px;
  }

  .detail-content {
    flex-direction: column;
  }

  .chart-card,
  .action-card {
    max-width: none;
    padding: 20px;
  }

  .chart-header {
    flex-direction: column;
  }

  .chart-controls {
    align-items: flex-start;
  }

  .chart-empty {
    height: 280px;
  }

  .creation-hero h1 {
    font-size: 28px;
  }

  .creation-layout {
    flex-direction: column;
  }

  .creation-form,
  .creation-note {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .autara-nav {
    min-height: 80px;
    padding: 20px 64px;
  }

  .autara-logo-mobile {
    display: none;
  }

  .autara-logo-desktop {
    display: block;
  }

  .testnet-pill {
    width: 70px;
    transform: translateY(3px);
  }

  .desktop-nav {
    display: flex;
  }

  .connect-wallet {
    margin-left: 0;
  }

  .autara-main {
    padding-top: 112px;
    padding-bottom: 40px;
  }

  .feature-list {
    display: flex;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .desktop-footer {
    display: block;
  }
}

@media (min-width: 1280px) {
  .markets-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
