@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;600;700;800&family=RocknRoll+One&family=Rubik+Doodle+Shadow&display=swap");

:root {
  --color-orange: #fc9210;
  --color-gold: #ffc959;
  --color-brown: #773d00;
  --color-lemon: #f7e468;
  --color-dark: #120b07;
  --color-primary: #fea802;
  --color-primary-hover: #edf028;
  --color-text: #f7ead9;
  --color-heading: #ffd37d;
  --color-muted: rgba(247, 234, 217, 0.8);
  --color-footer: rgba(247, 234, 217, 0.66);
  --bg-body: radial-gradient(circle at top, #3b1602 0%, #160c07 48%, #090909 100%);
  --page-overlay: rgba(0, 0, 0, 0.12);
  --card-bg: linear-gradient(165deg, rgba(14, 10, 8, 0.92) 0%, rgba(31, 18, 9, 0.86) 100%);
  --card-border: rgba(255, 178, 73, 0.22);
  --card-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(254, 168, 2, 0.14);
  --nav-border: rgba(254, 168, 2, 0.5);
  --nav-color: #ffe8b8;
  --nav-active-bg: #773d00;
  --nav-active-border: #c9750e;
  --nav-active-color: #f7e468;
  --focus-color: #f7931a;
  --cta-bg: linear-gradient(180deg, #fea802 0%, #ecf129 100%);
  --cta-color: #421600;
  --cta-border: #fea802;
  --icon-btn-bg: rgba(254, 168, 2, 0.14);
  --icon-btn-border: rgba(254, 168, 2, 0.55);
  --icon-btn-hover-bg: #773d00;
  --icon-btn-color: #ffe8b8;
  --section-title: #ffd37d;
  --section-border: rgba(255, 178, 73, 0.22);
  --section-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --lines-color-1: rgba(255, 201, 89, 0.12);
  --lines-color-2: rgba(255, 128, 0, 0.08);
  --docs-nav-bg: rgba(22, 14, 9, 0.82);
  --docs-article-bg: rgba(18, 12, 8, 0.82);
  --status-bg: rgba(22, 15, 9, 0.84);
  --status-item-bg: rgba(255, 255, 255, 0.04);
  --chart-slice-outline: #ffefc2;
  --chart-label-color: #f7d28d;
  --chart-label-percent: #f9a825;
  --chart-line-color: #d48e36;
  --contract-link-color: #ffffff;
  --contract-link-hover: #ffd37d;
  --icon-action-border: #b96a08;
  --icon-action-bg: rgba(254, 168, 2, 0.12);
  --icon-action-hover-bg: rgba(254, 168, 2, 0.22);
  --icon-action-color: #ffc959;
  --token-spec-bg: rgba(255, 255, 255, 0.05);
  --token-label-color: #ffd37d;
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 22px rgba(0, 0, 0, 0.24);
}

:root[data-theme="light"] {
  --color-text: #2b1808;
  --color-heading: #6e3400;
  --color-muted: rgba(43, 24, 8, 0.74);
  --color-footer: rgba(43, 24, 8, 0.54);
  --bg-body: radial-gradient(circle at top, #fff7c7 0%, #f7e468 34%, #ffc959 68%, #fc9210 100%);
  --page-overlay: rgba(255, 255, 255, 0.14);
  --card-bg: rgba(255, 255, 255, 0.74);
  --card-border: rgba(119, 61, 0, 0.18);
  --card-shadow: 0 12px 28px rgba(119, 61, 0, 0.12);
  --nav-bg: #c5a334;
  --nav-border: #c9750e;
  --nav-color: #ffffff;
  --nav-active-bg: #773d00;
  --nav-active-border: #421600;
  --nav-active-color: #f7e468;
  --icon-btn-bg: #fea802;
  --icon-btn-border: #fea802;
  --icon-btn-hover-bg: #edf028;
  --icon-btn-color: #ffffff;
  --section-title: #6e3400;
  --section-border: rgba(119, 61, 0, 0.18);
  --section-shadow: 0 12px 28px rgba(119, 61, 0, 0.12);
  --lines-color-1: rgba(255, 201, 89, 0.22);
  --lines-color-2: rgba(119, 61, 0, 0.1);
  --docs-nav-bg: rgba(255, 255, 255, 0.62);
  --docs-article-bg: rgba(255, 255, 255, 0.72);
  --status-bg: rgba(255, 255, 255, 0.58);
  --status-item-bg: rgba(255, 255, 255, 0.62);
  --chart-slice-outline: #fff4c7;
  --chart-label-color: #3a220a;
  --chart-label-percent: #f08400;
  --chart-line-color: #7a4a12;
  --contract-link-color: #000000;
  --contract-link-hover: #773d00;
  --icon-action-border: #773d00;
  --icon-action-bg: #f7e468;
  --icon-action-hover-bg: #ffc959;
  --icon-action-color: #773d00;
  --token-spec-bg: rgba(255, 248, 222, 0.74);
  --token-label-color: #6e3400;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--bg-body);
  background-size: 100% 100%;
  background-attachment: fixed;
  transition: background 0.35s ease, color 0.35s ease;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:focus,
button:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.moving-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--lines-color-1) 0,
      var(--lines-color-1) 2px,
      transparent 2px,
      transparent 24px
    ),
    repeating-linear-gradient(
      45deg,
      var(--lines-color-2) 0,
      var(--lines-color-2) 1px,
      transparent 1px,
      transparent 32px
    );
  background-size: 220px 220px;
  animation: linesFlow 18s linear infinite;
  transition: opacity 0.35s ease;
}

@keyframes linesFlow {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 220px -220px, -220px 220px;
  }
}

@keyframes darkGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

:root[data-theme="dark"] body {
  background-size: 400% 400%;
  animation: darkGradient 15s ease infinite;
}

:root[data-theme="dark"] .moving-lines {
  opacity: 0;
  animation: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px clamp(18px, 4vw, 56px) 10px;
  background: linear-gradient(180deg, var(--page-overlay), transparent 220px);
}

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 3vh;
}

.brand-row {
  display: flex;
  align-items: center;
}

.brand-row-empty {
  min-height: 1px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: clamp(160px, 18vw, 240px);
  object-fit: contain;
}

.top-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--nav-border);
  background: var(--nav-bg);
  color: var(--nav-color);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.top-button:hover {
  transform: translateY(-2px);
  background: var(--color-primary-hover);
  color: #421600;
  box-shadow: var(--shadow-sm);
}

.top-button.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--nav-active-color);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--icon-btn-border);
  background: var(--icon-btn-bg);
  color: var(--icon-btn-color);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  background: var(--icon-btn-hover-bg);
  box-shadow: var(--shadow-sm);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

main {
  flex: 1;
}

.landing-shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-top: -14px;
}

.logo-sphere {
  width: min(100%, 240px);
  animation: floatLogo 3s ease-in-out infinite;
}

.logo-sphere img {
  width: 100%;
  display: block;
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-tagline {
  margin: 0;
  font-family: "RocknRoll One", "Trebuchet MS", sans-serif;
  font-size: clamp(16px, 2.2vw, 22px);
  color: var(--section-title);
}

.section-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  isolation: isolate;
  margin-top: 10vh;
}

.section-switch::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: var(--cta-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  z-index: 0;
}

.section-switch[data-active="api"]::before {
  transform: translateX(100%);
}

.switch-btn {
  position: relative;
  z-index: 1;
  min-width: 118px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--nav-color);
  font-family: "Public Sans", "Trebuchet MS", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.24s ease;
}

.switch-btn:hover {
  transform: translateY(-1px);
}

.switch-btn.active {
  color: var(--cta-color);
}

.section-panel {
  padding: clamp(20px, 3vw, 30px);
  border-radius: 28px;
  border: 1px solid var(--section-border);
  background: var(--card-bg);
  box-shadow: var(--section-shadow);
  backdrop-filter: blur(10px);
}

.panel-hidden {
  display: none;
}

.app-panel {
  width: min(40vw, 760px);
  max-width: 100%;
  align-self: center;
}

.app-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.app-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.app-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid var(--cta-border);
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-color);
  text-decoration: none;
  font-family: "Public Sans", "Trebuchet MS", sans-serif;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.app-button {
  min-width: 170px;
}

.app-button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(119, 61, 0, 0.25);
}

.app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.app-text {
  font-weight: 800;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.contract-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.graffiti {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(18px, 2.5vw, 26px);
  letter-spacing: 1px;
  color: var(--section-title);
  text-shadow: 2px 2px 0 rgba(252, 146, 16, 0.7), 4px 4px 0 rgba(255, 201, 89, 0.26);
}

.contract-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.contract-link {
  color: var(--contract-link-color);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
  font-size: clamp(16px, 2.45vw, 23px);
  line-height: 1.3;
  font-style: italic;
  font-family: "Rubik Doodle Shadow", "Trebuchet MS", sans-serif;
  transition: color 0.3s ease;
}

.contract-link:hover {
  color: var(--contract-link-hover);
}

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-action {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 2px solid var(--icon-action-border);
  background: var(--icon-action-bg);
  color: var(--icon-action-color);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: var(--icon-action-hover-bg);
}

.icon-action::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #1f1209;
  color: #f7e468;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.icon-action:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.icon-action svg {
  width: 18px;
  height: 18px;
}

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

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100%;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 178, 73, 0.4);
}

.card.disabled {
  opacity: 0.74;
}

.card-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(254, 168, 2, 0.1);
  color: var(--section-title);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--color-text);
}

.card p {
  margin: 0 0 18px;
  color: var(--color-muted);
  line-height: 1.6;
}

.status {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--status-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.status h3 {
  margin: 0 0 12px;
  color: var(--section-title);
  font-size: 18px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--status-item-bg);
  border: 1px solid var(--card-border);
}

.status-name {
  font-weight: 700;
}

.status-value {
  font-weight: 800;
}

.status-item.online .status-value {
  color: #49de8c;
}

.status-item.degraded .status-value {
  color: #ffd27d;
}

.status-item.offline .status-value {
  color: #ff9ba7;
}

.status-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-footer);
}

.api-panel {
  width: 100%;
}

.footer-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  color: var(--color-footer);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  flex-wrap: wrap;
}

.footer-bar a {
  color: inherit;
  text-decoration: none;
}

.footer-bar a:hover {
  color: var(--section-title);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 24px;
  padding: 18px;
  border-radius: 22px;
  background: var(--docs-nav-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.docs-nav-title {
  margin-bottom: 12px;
  color: var(--section-title);
  font-weight: 800;
}

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-nav-group + .docs-nav-group {
  margin-top: 12px;
}

.docs-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.docs-nav a:hover {
  color: var(--section-title);
}

.docs-sub-link {
  padding-left: 10px;
  font-size: 13px;
  color: var(--color-muted);
}

.docs-article {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 26px;
  background: var(--docs-article-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.docs-article section {
  scroll-margin-top: 24px;
}

.docs-article h1 {
  margin: 0 0 14px;
  color: var(--section-title);
  font-size: clamp(28px, 4vw, 38px);
}

.docs-article h2 {
  margin: 18px 0 10px;
  color: var(--section-title);
  font-size: clamp(20px, 3vw, 28px);
}

.docs-article p,
.docs-article li {
  margin: 0 0 12px;
  line-height: 1.7;
  color: var(--color-text);
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.token-spec {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  background: var(--token-spec-bg);
  border: 1px solid var(--card-border);
}

.token-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 14px;
  align-items: start;
}

.token-label {
  font-weight: 800;
  color: var(--token-label-color);
}

.token-value {
  word-break: break-word;
}

.tokenomics-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  padding: 0 4px 40px;
  border-radius: 28px;
  background: var(--docs-article-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--section-shadow);
}

.supply {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 800;
  color: var(--section-title);
  text-align: center;
  margin: 0;
  line-height: 1.2;
}

.chart-wrap {
  width: min(1000px, 100%);
  aspect-ratio: 20 / 6;
  overflow: visible;
  margin-top: 60px;
}

#tokenomicsChart {
  width: 100%;
  height: 100%;
  overflow: visible;
  user-select: none;
  transform: scale(1.2);
  transform-origin: center;
}

.slice {
  cursor: pointer;
  transition: transform 0.2s ease;
  transform-origin: 400px 210px;
}

.slice:hover {
  transform: scale(1.04);
}

.slice-outline {
  stroke: var(--chart-slice-outline);
  stroke-width: 2;
}

.label-group text {
  font-size: 12px;
  fill: var(--chart-label-color);
  font-weight: 900;
}

.label-name {
  font-weight: 900;
  font-size: 13px;
  fill: var(--chart-label-color);
  stroke: none;
}

.label-value {
  font-size: 12px;
  font-weight: 800;
  fill: var(--color-text);
}

.label-percent {
  fill: var(--chart-label-percent);
}

.label-group.active .label-value,
.label-group.active text {
  font-size: 14px;
}

.label-line {
  fill: none;
  stroke: var(--chart-line-color);
  stroke-width: 2;
}

.theme-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--nav-border);
  background: var(--nav-bg);
  color: var(--section-title);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover {
  background: var(--icon-btn-hover-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

@media (max-width: 1180px) {
  .links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1101px) {
  .docs-article {
    margin-right: 20vw;
  }
}

@media (max-width: 1100px) {
  header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .header-actions {
    justify-content: center;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: relative;
    top: 0;
  }
}

@media (max-width: 860px) {
  .hero-center {
    margin-top: 0;
  }

  .section-switch {
    margin-top: 24px;
  }

  .app-panel {
    width: 100%;
  }

  .app-actions {
    flex-wrap: wrap;
  }

  .section-switch {
    width: min(100%, 340px);
  }

  .switch-btn {
    flex: 1 1 0;
  }
}

@media (max-width: 720px) {
  .page {
    gap: 28px;
    padding-inline: 16px;
  }

  .brand-logo {
    width: clamp(150px, 48vw, 220px);
  }

  .logo-sphere {
    width: min(100%, 210px);
  }

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

  .section-panel,
  .docs-article,
  .tokenomics-shell {
    border-radius: 22px;
  }

  .card {
    padding: 18px;
  }

  .contract-line,
  .action-row {
    gap: 10px;
  }

  .status-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-value {
    word-break: break-word;
  }

  .docs-nav {
    padding: 14px;
    border-radius: 18px;
  }

  .docs-nav-group {
    gap: 10px;
  }

  .docs-nav a {
    display: inline-flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
  }

  .docs-sub-link {
    padding-left: 0;
    font-size: 13px;
  }

  .docs-article {
    gap: 18px;
    padding: 18px 16px;
  }

  .docs-article p,
  .docs-article li {
    line-height: 1.6;
  }

  .tokenomics-shell {
    padding: 0 0 24px;
  }

  .chart-wrap {
    width: 100%;
    aspect-ratio: auto;
    margin-top: 28px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .label-group text {
    font-size: 10px;
  }

  .label-group.active .label-value,
  .label-group.active text {
    font-size: 12px;
  }

  .token-row {
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  #tokenomicsChart {
    width: 800px;
    min-width: 800px;
    height: auto;
    transform: none;
  }
}

@media (max-width: 640px) {
  .theme-toggle {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }

  .contract-link {
    font-size: 18px;
    line-height: 1.4;
  }

  .hero-tagline {
    font-size: 15px;
  }

  .app-actions {
    flex-direction: column;
  }

  .app-button {
    width: 100%;
    min-width: 0;
  }

  .switch-btn {
    min-width: 0;
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  .graffiti {
    font-size: 16px;
    line-height: 1.3;
  }

  .contract-card {
    gap: 14px;
  }

  .icon-action::after,
  .add-token-icon::after {
    display: none;
  }

  .status {
    padding: 16px;
    border-radius: 16px;
  }

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

  .docs-layout {
    gap: 16px;
  }

  .docs-nav-title {
    margin-bottom: 10px;
  }

  .docs-article h1 {
    font-size: 28px;
  }

  .docs-article h2 {
    font-size: 20px;
  }

  .token-spec {
    padding: 16px;
    border-radius: 16px;
  }

  .supply {
    padding-inline: 16px;
  }

  .section-switch {
    width: 100%;
    max-width: 320px;
  }
}

/* =========================================================
   BFP Bridge page
   ========================================================= */

.bfp-page {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bfp-hero {
  display: flex;
  justify-content: center;
}

.bfp-hero-row {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.bfp-hero .bfp-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

.bfp-hero-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.bfp-hero-text h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  color: var(--section-title);
}

.bfp-hero-text p {
  margin: 0;
  color: var(--color-muted);
}

.bridge-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.bfp-wallet {
  grid-column: 3;
  justify-self: start;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 180px;
}

.wallet-info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-weight: 700;
  font-family: monospace;
  font-size: 14px;
}

.wallet-address {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bridge-card {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 560px;
  max-width: 100%;
  padding: clamp(20px, 4vw, 32px);
  border-radius: 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--section-shadow);
  backdrop-filter: blur(10px);
  transform: scale(0.8);
  transform-origin: top center;
}

.network-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--section-title);
}

.add-token-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--icon-action-bg);
  color: var(--icon-action-color);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.2s ease, background 0.2s ease;
}

.add-token-icon:hover {
  transform: translateY(-2px);
  background: var(--icon-action-hover-bg);
}

.add-token-icon svg {
  width: 16px;
  height: 16px;
}

.add-token-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1f1209;
  color: #f7e468;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(6px);
  z-index: 10;
}

.add-token-icon:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.network-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.network-button:hover {
  border-color: rgba(255, 178, 73, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.network-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
}

.network-name {
  flex: 1;
  font-weight: 800;
  font-size: 16px;
}

.network-balance {
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 600;
  font-family: monospace;
}

.amount-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.amount-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
  outline: none;
}

.amount-row input:focus {
  border-color: var(--focus-color);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--icon-action-bg);
  color: var(--icon-action-color);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--icon-action-hover-bg);
}

.swap-btn {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--nav-bg);
  color: var(--nav-color);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  display: grid;
  place-items: center;
}

.swap-btn:hover {
  transform: rotate(180deg);
  background: var(--icon-btn-hover-bg);
}

.custom-recipient {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.custom-recipient label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-muted);
  cursor: pointer;
}

.custom-recipient input[type="text"] {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.custom-recipient input[type="text"]:focus {
  border-color: var(--focus-color);
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  font-size: 14px;
}

.quote-row span:first-child {
  color: var(--color-muted);
}

.quote-row span:last-child {
  font-weight: 800;
  font-family: monospace;
}

.bridge-action {
  min-height: 54px;
  font-size: 18px;
}

.bridge-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
}

.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 150px;
  text-align: center;
}

.step-ring {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--card-border);
  z-index: 1;
}

.step-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--color-primary);
  border-right-color: var(--color-primary);
  animation: stepSpin 1s linear infinite;
}

@keyframes stepSpin {
  to {
    transform: rotate(360deg);
  }
}

.status-step[data-state="active"] .step-circle {
  color: var(--section-title);
  border-color: var(--color-primary);
  background: rgba(254, 168, 2, 0.14);
}

.status-step[data-state="active"] .step-spinner {
  display: block;
}

.status-step[data-state="pending"] .step-circle {
  color: var(--color-muted);
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.04);
}

.status-step[data-state="completed"] .step-circle {
  color: #120b07;
  background: #49de8c;
  border-color: #49de8c;
}

.step-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--section-title);
}

.step-status {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text);
  word-break: break-word;
  min-width: 0;
}

.step-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.step-link:hover {
  text-decoration: underline;
}

.step-estimate {
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 600;
}

.status-connector {
  flex: 1 1 auto;
  min-width: 16px;
  height: 2px;
  margin-top: 18px;
  background: var(--card-border);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.status-step[data-state="completed"] + .status-connector,
.status-step[data-state="active"] + .status-connector {
  background: linear-gradient(90deg, #49de8c, var(--color-primary));
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(100%, 420px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 26px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--section-shadow);
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-title {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--section-title);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
}

.wallet-list,
.network-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-option,
.network-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-align: left;
  width: 100%;
}

.wallet-option:hover,
.network-option:hover {
  border-color: rgba(255, 178, 73, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.wallet-option img,
.network-option img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.wallet-option svg,
.network-option svg {
  width: 36px;
  height: 36px;
}

.wallet-name,
.network-option span {
  flex: 1;
  font-weight: 800;
  font-size: 15px;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 360px);
  pointer-events: none;
}

.toast {
  position: relative;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--section-shadow);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-color: rgba(73, 222, 140, 0.5);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.5);
}

.toast.info {
  border-color: rgba(254, 168, 2, 0.5);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  width: 100%;
  transform-origin: left;
  animation: toastProgress 10s linear forwards;
}

@keyframes toastProgress {
  to {
    transform: scaleX(0);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .bridge-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .bfp-wallet {
    grid-column: auto;
    justify-self: auto;
    align-items: center;
    order: -1;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .bridge-card {
    grid-column: auto;
    justify-self: auto;
    width: min(560px, 100%);
    transform: none;
  }
}

@media (max-width: 640px) {
  .bfp-page {
    padding: 0;
  }

  .bfp-hero-row {
    flex-direction: column;
    text-align: center;
  }

  .bfp-hero-text {
    text-align: center;
  }

  .bfp-hero .bfp-logo {
    width: 64px;
    height: 64px;
  }

  .bridge-card {
    width: 100%;
    padding: 18px 16px;
    border-radius: 22px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .top-button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }

  .header-actions {
    gap: 10px;
  }

  .bfp-wallet {
    align-items: stretch;
  }

  .bfp-wallet .btn,
  .wallet-info {
    width: 100%;
    justify-content: space-between;
  }

  .wallet-info {
    padding: 10px 12px;
  }

  .network-button {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 6px;
  }

  .network-name {
    min-width: 0;
  }

  .network-balance {
    width: 100%;
    padding-left: 48px;
    text-align: left;
  }

  .amount-row {
    flex-wrap: wrap;
  }

  .amount-row input,
  .btn-secondary {
    width: 100%;
  }

  .quote-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-timeline {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .status-step {
    max-width: none;
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .status-step > *:not(.step-ring) {
    flex: 1 1 auto;
  }

  .status-connector {
    display: none;
  }

  .step-status,
  .step-link,
  .step-estimate {
    width: 100%;
    padding-left: 52px;
  }

  .step-link {
    white-space: normal;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .wallet-info {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .page {
    padding-inline: 12px;
  }

  .bridge-action {
    font-size: 16px;
  }

  .section-panel,
  .docs-article,
  .tokenomics-shell,
  .card,
  .docs-nav {
    border-radius: 18px;
  }

  .top-button {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .status {
    padding: 14px;
  }

  .card h3 {
    font-size: 20px;
  }

  .card p,
  .docs-article p,
  .docs-article li,
  .token-value {
    font-size: 14px;
  }

  .supply {
    font-size: 15px;
  }

  #tokenomicsChart {
    width: 720px;
    min-width: 720px;
  }

  .step-status,
  .step-link,
  .step-estimate {
    padding-left: 0;
  }
}
