body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #0d0d0d;
  color: #e6e6e6;
}

/* HERO */
.hero {
  width: 100%;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 30px;
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
}

/* INTRO */
.intro {
  text-align: center;
  padding: 30px 20px 10px;
  max-width: 620px;
  margin: 0 auto;
}

.tagline {
  font-size: 1.3em;
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 25px;
}

/* SECTIONS */
section {
  padding: 40px 20px;
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

/* CONSISTENT SPACING BETWEEN SECTIONS */
section + section {
  border-top: 1px solid #1a1a1a;
}

/* TYPOGRAPHY */
h1,
h2 {
  text-align: center;
}

h1 {
  font-weight: 700;
  font-size: 2em;
  margin-bottom: 10px;
}

h2 {
  color: #ff3b3b;
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 0;
}

/* BODY TEXT */
section p {
  line-height: 1.75;
  margin-bottom: 18px;
  color: #d0d0d0;
}

/* LISTS */
section ul,
section ol {
  margin: 15px 0 20px;
  padding-left: 20px;
}

section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* BUTTONS */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cta-button {
  padding: 10px 18px;
  background: #ff3b3b;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
}

.cta-button,
.cta-button:visited,
.cta-button:hover,
.cta-button:active {
  color: #fff !important;
}

.cta-button:hover {
  background: #cc2f2f;
}

.cta-button.secondary {
  background: #222;
  border: 1px solid #444;
}

/* CENTERED SINGLE BUTTON */
.center-button {
  text-align: center;
  margin-top: 30px;
}

/* LINKS */
a {
  color: #ff3b3b;
}

/* INPUT */
input {
  width: 100%;
  padding: 10px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  border-radius: 4px;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid #333;
  color: #888;
  font-size: 0.9em;
}

/* EXCHANGE LAYOUT */
.exchange-container {
  display: flex;
  gap: 40px;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.exchange-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 30px;
}

.exchange-intro p {
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* WALLET BOX */
.wallet-box,
.trade-box {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 20px;
}

/* TRADE BOX */
.trade-box {
  background: #111;
  border: 1px solid #222;
  padding: 20px;
  border-radius: 8px;
}

.trade-box h2 {
  margin-top: 0;
  text-align: left;
}

.amount-row {

  display: flex;

  gap: 10px;

  align-items: center;
}

.amount-row input {

  flex: 1;
}

#maxProposalBtn {

  min-width: 90px;
}

/* CANVAS */
#curveCanvas {
  width: 100%;
  height: 300px;
  margin-top: 30px;
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
}

/* MOBILE */
@media (max-width: 900px) {
  .exchange-container {
    flex-direction: column;
  }

  .exchange-right {
    margin-top: 20px; /* FIX */
  }

  .exchange-intro {
    text-align: center;
    padding: 0 10px;
  }

  .wallet-box {
    margin-top: 20px;
  }

  #curveCanvas {
    height: 220px;
  }
}

/* DAO STEPS */
.dao-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 20px auto;
}

.dao-step {
  background: #111;
  border: 1px solid #222;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  color: #aaa;
  transition: 0.2s;
}

.dao-step.active {
  border-color: #ff3b3b;
  color: #fff;
}

.dao-step.complete {
  border-color: #4dff88;
  color: #4dff88;
}

/* ===== MOBILE GLOBAL FIXES ===== */

@media (max-width: 768px) {

  body {
    overflow-x: hidden;
  }

  section {
    padding: 30px 16px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.4em;
  }

  .hero-img {
    width: 100%;
    height: auto;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-button {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  input,
  select,
  textarea {
    box-sizing: border-box;
    font-size: 16px;
  }

  .center-button {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .center-button .cta-button {
    width: 100%;
  }

  .wallet-box,
  .trade-box {
    overflow-wrap: break-word;
  }

}

/* ===== WHITEPAPER MOBILE ===== */

@media (max-width: 900px) {

  .page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  .sidebar a {
    display: inline-block;
    margin: 6px 10px 6px 0;
    font-size: 0.85em;
  }

  .content {
    padding: 30px 18px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .block {
    overflow-x: auto;
    word-break: break-all;
  }

}

.dao-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.dao-buttons .cta-button {
  min-width: 180px;
}

/* MOBILE */
@media (max-width: 768px) {

  .dao-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .dao-buttons .cta-button {
    width: 100%;
  }

}

/* ===== MODAL ===== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content p {
  color: #ccc;
  line-height: 1.7;
}

.hidden {
  display: none;
}

/* ===== CERTIFICATE ===== */

#certificateBox {
  margin-top: 30px;
  text-align: center;
}

#certificateText {
  color: #ccc;
  margin-bottom: 20px;
  line-height: 1.6;
}

#certificateBox {

  border:
    1px solid #4dff88;

  background:
    rgba(255,255,255,0.03);
}

#certificateBox h2 {

  text-align: center;
}

#certificateBox {

  text-align: center;
}

#loadingOverlay {

  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background:
    rgba(0,0,0,0.75);

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

  z-index: 9999;
}

.spinner {

  box-sizing: border-box;

  width: 60px;
  height: 60px;

  border: 6px solid #333;

  border-top:
    6px solid #ff3b3b;

  border-radius: 50%;

  animation:
    spin 1s linear infinite;

  margin-bottom: 20px;

}

@keyframes spin {

  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hidden {

  display: none !important;
}

#loadingOverlay.hidden {
  display: none !important;
  pointer-events: none;
}

#loadingOverlay {
  pointer-events: all;
}

.exchange-container {
  display: flex;
  gap: 40px;
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  align-items: stretch;
}

.exchange-left,
.exchange-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exchange-left .trade-box:last-child {
  flex: 1;
}

.exchange-left {
  justify-content: stretch;
}

.exchange-right {
  justify-content: stretch;
}

.wallet-box {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 20px;
}

.wallet-box p {
  text-align: center;
}

.wallet-box h2 {
  text-align: center;
}

.center-content {
  text-align: center;
}

.center-content p {
  text-align: center;
}

.center-status {
  text-align: center;
}

.center-status h2 {
  text-align: center;
}

.center-status p {
  text-align: center;
}

.status-box {
  flex-grow: 1;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

#statusMessage {
  text-align: center;
}

#proposalDescription {
  width: 100%;
  box-sizing: border-box;

  background: #111;
  color: #fff;

  border: 1px solid #222;
  border-radius: 8px;

  padding: 12px;

  font-family: inherit;
  font-size: 1rem;

  resize: none;

  min-height: 140px;
}

#proposalDescription:focus {
  outline: none;
  border-color: #ff3b3b;
}

/* ===== INFO PANELS ===== */

.info-box {
  background: #111;
  border: 1px solid #333;
  border-left: 4px solid #ff3b3b;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
}

.info-box h3 {
  margin-top: 0;
  color: #ff3b3b;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.info-box ul {
  margin-bottom: 0;
}

/* ===== WARNING BOX ===== */

.warning-box {
  background: rgba(255,59,59,0.08);
  border: 1px solid #ff3b3b;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
}

.warning-box h3 {
  margin-top: 0;
  color: #ff3b3b;
}

/* ===== SUCCESS BOX ===== */

.success-box {
  background: rgba(77,255,136,0.08);
  border: 1px solid #4dff88;
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
}

.success-box h3 {
  margin-top: 0;
  color: #4dff88;
}

/* ===== FAQ ===== */

.faq-item {
  margin-bottom: 35px;
}

.faq-item h3 {
  color: #ff3b3b;
  margin-bottom: 10px;
}

/* ===== ONBOARDING STEPS ===== */

.onboarding-step {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.onboarding-step h3 {
  margin-top: 0;
  color: #ff3b3b;
}

@keyframes fadeIn {

  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }

}

/* =====================================================
   WHITEPAPER LAYOUT
   ===================================================== */

.page {
    display: flex;
    justify-content: center;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.content {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.whitepaper-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px 80px;
    box-sizing: border-box;
}

.whitepaper-container h1 {
    margin-top: 60px;
}

.whitepaper-container h2 {
    margin-top: 50px;
}

.whitepaper-container h3,
.whitepaper-container p,
.whitepaper-container li {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

.whitepaper-container h3 {
    margin-top: 35px;
    margin-bottom: 20px;
}

.subtitle {
    text-align: center;
    color: #aaa;
    font-size: 1.1rem;
    margin-top: -10px;
    margin-bottom: 30px;
}

/* =====================================================
   DOCUMENT META
   ===================================================== */

.document-meta {
    max-width: 75ch;
    margin: 40px auto;
    text-align: center;
    color: #bbb;
}

/* =====================================================
   READABILITY
   ===================================================== */

p,
li {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

p:empty {
    display: none;
}

/* =====================================================
   MERMAID
   ===================================================== */

.mermaid {
    text-align: center;
    margin: 40px auto;
    overflow-x: auto;
}

.mermaid svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* =====================================================
   TABLES
   ===================================================== */

figure.table-figure {
    margin: 2rem auto;
    overflow-x: auto;
}

figure.table-figure table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

figure.table-figure th,
figure.table-figure td {
    border: 1px solid #333;
    padding: 12px;
    text-align: left;
}

figure.table-figure th {
    background: #151515;
    color: #ffffff;
}

figure.table-figure td {
    background: #111111;
}

figure.table-figure tr:nth-child(even) td {
    background: #161616;
}