:root {
  --color-primary-bg: #02120e;
  --color-secondary-bg: #1c473c;
  --color-accent-light: #8fbfb3;
  --color-accent-dark: #0b3a2e;
  --color-accent-mid: #5c8a7e;
  --header-height: 70px;
}

html,
body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-primary-bg);
  color: var(--color-accent-light);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-height);
}

/* Header always on top */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
}

.navbar {
  background: var(--color-secondary-bg);
  color: var(--color-accent-light);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  min-height: var(--header-height);
}

.logo {
  font-weight: bold;
  padding: 1rem 0;
}

.logo img {
  height: 40px;
  width: auto;
}

.language-select {
  margin-left: auto;
}

.language-select select {
  background: transparent;
  color: var(--color-accent-light);
  border: 1px solid var(--color-accent-light);
  padding: .25rem;
}

.auth {
  margin-left: 1rem;
  display: flex;
  align-items: center;
}

#connect-wallet {
  min-width: 180px;
  height: 2.5rem;
}

#account {
  margin-left: .5rem;
}

.menu-toggle {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  margin-left: 1rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--color-accent-light);
  margin-bottom: 4px;
}

.menu {
  list-style: none;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}

.menu li {
  position: relative;
  margin: 0 .5rem;
}

.menu a {
  color: var(--color-accent-light);
  text-decoration: none;
  white-space: nowrap;
}

/* Desktop dropdown */
.menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-secondary-bg);
  border: 1px solid var(--color-accent-light);
  border-radius: 10px;
  padding: .5rem 0;
  min-width: 220px;
  z-index: 6000;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
  display: none;
}

.menu li.open > ul {
  display: block;
}

@media (hover: hover) {
  .menu li:hover > ul {
    display: block;
  }
}

.menu li ul li {
  padding: .5rem 1rem;
}

.menu li ul li:hover {
  background: var(--color-accent-mid);
}

/* ===== Mobile: ≤980px ===== */
@media (max-width: 980px) {
  .hamburger {
    display: flex;
  }

  .menu {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: .5rem;
    width: clamp(240px, 85vw, 360px);
    background: var(--color-secondary-bg);
    padding: 1rem;
    border-radius: 12px;
    display: none;
    z-index: 5500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  }

  .menu li {
    margin: 0;
    width: 100%;
    padding: .5rem .25rem;
  }

  .menu li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .menu li.cta > a.cta-nav {
    width: auto;
    justify-content: center;
  }

  .menu li > ul {
    position: static !important;
    display: none;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: .35rem 0 0 0;
    width: 100%;
  }

  .menu li.open > ul {
    display: block;
  }

  .menu li ul li {
    padding: .4rem 1rem;
    white-space: normal;
  }

  .menu-toggle:checked ~ .menu {
    display: flex;
  }

  .menu li.cta {
    margin-left: 0;
  }
}

/* CTA right */
.menu li.cta {
  margin-left: .5rem;
}

.navbar .menu li.cta > a.cta-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .1px;
  padding: .40rem .80rem;
  border-radius: 12px;
  border: 1px solid #ffffffbf;
  background-image: linear-gradient(180deg, #b9dcd4, #a9d6cc);
  background-color: var(--color-accent-light);
  color: #0b2b24;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.navbar .menu li.cta > a.cta-nav:hover {
  filter: brightness(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .24);
  transform: translateY(-1px);
}

.navbar .menu a:hover:not(.cta-nav) {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.navbar .menu a:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}

/* Layout containers */
main,
.container {
  flex: 1 0 auto;
  padding: 2rem;
  max-width: 1000px;
  margin: 2rem auto;
}

.databox {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .04) 100%) !important;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(143, 191, 179, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  font-size: 1rem;
  color: #e8f3ee;
}

.databox::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, rgba(216, 166, 63, 0) 0%, rgba(216, 166, 63, .9) 50%, rgba(216, 166, 63, 0) 100%);
  opacity: .78;
}

/* Hero (generic) */
.hero-box {
  background: linear-gradient(180deg, rgba(6, 32, 26, .99) 0%, rgba(13, 52, 43, .98) 100%) !important;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 18px;
  border: 1px solid rgba(143, 191, 179, .16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #eef7f3;
}

.hero-box h1 {
  font-size: 2rem;
  color: #f4e5be;
  margin-bottom: 1rem;
}

.hero-box p {
  font-size: 1.1rem;
  color: #d3e2db;
  max-width: 600px;
  margin: auto;
}

/* Sections */
.light-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(6, 32, 26, .99) 0%, rgba(13, 52, 43, .98) 100%) !important;
  padding: 2rem;
  border-radius: 18px;
  border: 1px solid rgba(143, 191, 179, .16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  max-width: 1000px;
  margin: auto;
  color: #eef7f3;
}

.light-section::before,
.hero-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 180px at 100% 0%, rgba(216, 166, 63, .12), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
  opacity: .9;
  pointer-events: none;
  z-index: 0;
}

.hero-box > *,
.light-section > * {
  position: relative;
  z-index: 1;
}

/* Unterseiten: Kontrast-Sicherheitsnetz */
.hero-box .section-title,
.light-section .section-title,
.databox .section-title,
main .section-title {
  color: #f0d99d !important;
}

.hero-box :is(h1, h2, h3, h4, h5, h6),
.light-section :is(h1, h2, h3, h4, h5, h6),
.databox :is(h1, h2, h3, h4, h5, h6) {
  color: #f4efe0 !important;
}

.hero-box :is(p, li, label, dd, dt, small),
.light-section :is(p, li, label, dd, dt, small),
.databox :is(p, li, label, dd, dt, small) {
  color: #d8e6df !important;
}

.hero-box .muted,
.light-section .muted,
.databox .muted {
  color: #cfe0d8 !important;
}

.hero-box :is(input, textarea, select),
.light-section :is(input, textarea, select),
.databox :is(input, textarea, select) {
  background: rgba(1, 12, 9, .92) !important;
  color: #eef7f3 !important;
  border: 1px solid rgba(143, 191, 179, .35) !important;
}

.hero-box :is(.card, .quickcard, .notice, .alert, details, .summary .box, .live .card, .modal, .chart-wrap),
.light-section :is(.card, .quickcard, .notice, .alert, details, .summary .box, .live .card, .modal, .chart-wrap),
.databox :is(.card, .quickcard, .notice, .alert, details, .summary .box, .live .card, .modal, .chart-wrap),
main :is(.card, .chart-wrap) {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .04) 100%) !important;
  color: #e8f3ee !important;
  border: 1px solid rgba(143, 191, 179, .2) !important;
}

.hero-box :is(.card, .quickcard, .notice, .alert, details, .summary .box, .live .card, .modal, .chart-wrap)::before,
.light-section :is(.card, .quickcard, .notice, .alert, details, .summary .box, .live .card, .modal, .chart-wrap)::before,
main :is(.card, .chart-wrap)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(216, 166, 63, 0) 0%, rgba(216, 166, 63, .9) 50%, rgba(216, 166, 63, 0) 100%);
  opacity: .78;
}

.hero-box :is(a, summary),
.light-section :is(a, summary),
.databox :is(a, summary),
main :is(a.link-gold) {
  color: #f0d99d !important;
}

.hero-box :is(button, .btn),
.light-section :is(button, .btn),
.databox :is(button, .btn) {
  background: linear-gradient(180deg, #f0c86e 0%, #d8a63f 100%) !important;
  color: #13261f !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
}


.hero-box .databox > div,
.light-section .databox > div,
main .databox > div,
main .kv dd,
main .kv dt,
main .legend-badge,
main .kv-list,
main .kv-list li {
  color: #dbece5 !important;
}

.hero-box .databox strong,
.light-section .databox strong,
main .databox strong,
main .card h3,
main .chart-wrap h3 {
  color: #f4efe0 !important;
}


/* Fixes for page-local light boxes that broke contrast */
main .hero-gradient {
  background: linear-gradient(180deg, rgba(6, 32, 26, .99) 0%, rgba(13, 52, 43, .98) 100%) !important;
}

main :is(.quickcard, .alert, .notice, .faq details, .summary .box, .modal header, .modal main, .modal footer),
main [style*="background:#f8fafb"],
main [style*="background: #f8fafb"],
main [style*="background:#fff"],
main [style*="background: #fff"] {
  background: rgba(255, 255, 255, .06) !important;
  color: #e8f3ee !important;
  border-color: rgba(143, 191, 179, .22) !important;
}

main :is(.quickcard h3, .faq summary, .notice strong, .alert strong),
main [style*="background:#f8fafb"] strong,
main [style*="background: #f8fafb"] strong,
main [style*="background:#fff"] strong,
main [style*="background: #fff"] strong {
  color: #f4efe0 !important;
}

main :is(.quickcard p, .quickcard .muted, .faq p, .notice p, .alert p),
main [style*="background:#f8fafb"] :is(li, p, span),
main [style*="background: #f8fafb"] :is(li, p, span),
main [style*="background:#fff"] :is(li, p, span),
main [style*="background: #fff"] :is(li, p, span) {
  color: #dbece5 !important;
}

/* Legal pages (imprint / terms): force readable text in docs blocks */
main .docs-content {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .04) 100%) !important;
  border: 1px solid rgba(143, 191, 179, .22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 24px rgba(0, 0, 0, .14) !important;
}

main .docs-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(216, 166, 63, 0) 0%, rgba(216, 166, 63, .9) 50%, rgba(216, 166, 63, 0) 100%);
  opacity: .78;
}

main .doc-article,
main .doc-article :is(p, li, span, strong, em),
main .doc-article :is(h2, h3, h4),
main .docs-content,
main .lang-switch .lang-label {
  color: #dbece5 !important;
}

/* Tokenomics legend pills: keep contrast on dark theme */
main .legend-badge {
  background: rgba(255, 255, 255, .12) !important;
  border: 1px solid rgba(216, 166, 63, .45) !important;
  color: #f4efe0 !important;
}

main .doc-article a,
main .legal-toplink {
  color: #f0d99d !important;
}

main .lang-btn {
  background: linear-gradient(180deg, #f0c86e 0%, #d8a63f 100%) !important;
  color: #13261f !important;
  border: 1px solid rgba(255, 255, 255, .2) !important;
}

main .lang-note {
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid rgba(143, 191, 179, .22) !important;
  color: #e8f3ee !important;
}

/* Status pages: remove dark-on-dark text and restore readable chips/links */
main .timestamp,
main .mini,
main .kv dd,
main .kv dt,
main .title,
main .overall .muted {
  color: #dbece5 !important;
}

main .light-section .kv dd a {
  color: #f4efe0 !important;
  background: rgba(255, 255, 255, .1) !important;
  border: 1px solid rgba(216, 166, 63, .45) !important;
}

main .light-section .kv dd a:hover {
  border-color: rgba(240, 200, 110, .8) !important;
  box-shadow: 0 0 0 1px rgba(240, 200, 110, .22) inset !important;
}

main .ok {
  background: rgba(159, 216, 200, .22) !important;
  color: #dffaf1 !important;
  border: 1px solid rgba(159, 216, 200, .65) !important;
}

main .warn {
  background: rgba(240, 200, 110, .2) !important;
  color: #fff1cc !important;
  border: 1px solid rgba(240, 200, 110, .7) !important;
}

main .down {
  background: rgba(255, 138, 138, .2) !important;
  color: #ffdede !important;
  border: 1px solid rgba(255, 156, 156, .7) !important;
}

/* Roadmap / news timeline: keep absolute cards around the spline intact */
body.roadmap-page main .rm-item > .card {
  position: absolute !important;
  overflow: visible !important;
}

body.roadmap-page main .rm-item > .card::before {
  content: none !important;
}

footer {
  background: var(--color-accent-dark);
  color: var(--color-accent-light);
  padding: 1rem;
  text-align: center;
  margin-top: auto;
}
