:root {
  color-scheme: light;
  --ink: #11120f;
  --paper: #f4f2e9;
  --paper-deep: #e9e6da;
  --acid: #c9ff36;
  --acid-dark: #9bc918;
  --muted: #6d6f66;
  --rule: rgba(17, 18, 15, 0.16);
  --up: #16883f;
  --down: #d34331;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 10%, rgba(201, 255, 54, 0.32), transparent 25rem),
    var(--paper);
  font-family: "Space Grotesk", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

.site-header,
main,
footer {
  width: min(1380px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
}

nav a {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.73rem;
  text-decoration: none;
  transition: color 160ms ease;
}

nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  min-height: min(760px, calc(100svh - 84px));
  align-items: center;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 80px 7vw 80px 0;
}

.eyebrow,
.position-label {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.13em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--acid-dark);
  box-shadow: 0 0 0 5px rgba(155, 201, 24, 0.13);
}

h1 {
  max-width: 780px;
  margin: 24px 0 30px;
  font-size: clamp(5.6rem, 11vw, 10.8rem);
  line-height: 0.77;
  letter-spacing: -0.085em;
}

h1 em {
  color: var(--acid-dark);
  font-style: normal;
}

.hero-text {
  max-width: 650px;
  margin: 0;
  color: #4c4e47;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  line-height: 1.55;
}

.hero-text strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--acid);
}

.button-secondary {
  background: transparent;
}

.button-secondary:hover {
  background: var(--paper-deep);
}

.hero-art {
  position: relative;
  align-self: stretch;
  min-height: 600px;
  overflow: hidden;
  border-left: 1px solid var(--rule);
  background: #0c0d0b;
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.position-section,
.trade-history-section,
.token-section,
.how-it-works {
  padding: clamp(72px, 10vw, 140px) 0;
  border-bottom: 1px solid var(--rule);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 38px;
}

h2 {
  margin: 12px 0 0;
  font-size: clamp(3rem, 6vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
}

.sync-state.error .live-dot {
  background: var(--down);
  box-shadow: 0 0 0 5px rgba(211, 67, 49, 0.12);
}

.position-card {
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #10110e;
  color: var(--paper);
  box-shadow: 13px 13px 0 var(--acid);
}

.position-title,
.position-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px;
}

.position-title {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.position-title > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.position-title strong {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
}

.position-label {
  color: #9b9d94;
}

.asset-icon {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--acid);
  font-weight: 700;
}

.long-badge {
  padding: 8px 11px;
  border: 1px solid rgba(201, 255, 54, 0.35);
  color: var(--acid);
  background: rgba(201, 255, 54, 0.08);
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.metrics article {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}

.metrics article + article {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.metrics span,
.metrics small {
  color: #989a91;
  font-family: "DM Mono", monospace;
  font-size: 0.69rem;
}

.metric-value {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 4.2vw, 4.7rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.metric-value.positive {
  color: var(--acid);
}

.metric-value.negative {
  color: #ff7967;
}

.position-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #85877f;
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
}

.position-footer a {
  color: var(--paper);
  text-decoration: none;
}

.trade-ledger {
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #10110e;
  color: var(--paper);
  box-shadow: 13px 13px 0 var(--acid);
}

.trade-ledger-bar,
.trade-ledger-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
}

.trade-ledger-bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.trade-ledger-bar > div {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.trade-ledger-bar strong,
.trade-ledger-bar a,
.trade-ledger-footer {
  font-family: "DM Mono", monospace;
}

.trade-ledger-bar strong {
  color: var(--acid);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.trade-ledger-bar a {
  color: #d8dacd;
  font-size: 0.64rem;
  text-decoration: none;
}

.trade-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--acid-dark) #1a1b18;
}

.trade-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-family: "DM Mono", monospace;
}

.trade-table th,
.trade-table td {
  padding: 17px 20px;
  text-align: left;
  white-space: nowrap;
}

.trade-table th {
  color: #898b83;
  background: #191a17;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.trade-table td {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #c6c8bd;
  font-size: 0.72rem;
}

.trade-table tbody tr {
  transition: background 160ms ease;
}

.trade-table tbody tr:hover {
  background: rgba(201, 255, 54, 0.045);
}

.trade-table .trade-market,
.trade-table .trade-value {
  color: var(--paper);
}

.trade-table .trade-market strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
}

.open-long-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #57e68b;
}

.open-long-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.trade-table .trade-date {
  color: #a5a79d;
}

.trade-proof a {
  color: var(--acid);
  text-underline-offset: 3px;
}

.trade-loading-row td {
  height: 150px;
  color: #888a81;
  text-align: center;
}

.trade-ledger-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #85877f;
  font-size: 0.62rem;
}

.trade-ledger-footer button {
  padding: 9px 12px;
  border: 1px solid rgba(201, 255, 54, 0.45);
  color: var(--acid);
  background: rgba(201, 255, 54, 0.06);
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.trade-ledger-footer button:hover {
  color: var(--ink);
  background: var(--acid);
}

.token-section {
  display: grid;
  align-items: end;
  gap: clamp(40px, 8vw, 120px);
  grid-template-columns: 0.85fr 1.15fr;
}

.token-copy p {
  max-width: 580px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.token-copy a {
  color: var(--ink);
  font-weight: 600;
}

.contract-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--ink);
  background: var(--acid);
}

.contract-card .position-label {
  color: #34372b;
}

.contract-row {
  display: grid;
  align-items: stretch;
  margin-top: 18px;
  border: 1px solid var(--ink);
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--paper);
}

.contract-row code {
  overflow: hidden;
  padding: 18px;
  font-family: "DM Mono", monospace;
  font-size: clamp(0.66rem, 1.4vw, 0.82rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-row button {
  min-width: 88px;
  border: 0;
  border-left: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  font-family: "DM Mono", monospace;
  font-weight: 500;
  cursor: pointer;
}

.contract-card p {
  margin: 14px 0 0;
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
}

.how-it-works > .eyebrow {
  margin-bottom: 26px;
}

.steps {
  display: grid;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  grid-template-columns: repeat(3, 1fr);
}

.steps article {
  min-height: 260px;
  padding: 28px;
}

.steps article + article {
  border-left: 1px solid var(--ink);
}

.steps article > span {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
}

.steps h3 {
  margin: 60px 0 12px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.steps p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

footer {
  padding: 34px 0 42px;
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
}

footer > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

footer a {
  text-decoration: none;
}

footer p {
  max-width: 740px;
  margin: 42px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 74px 0 54px;
  }

  .hero-art {
    min-height: 560px;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

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

@media (max-width: 680px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1380px);
  }

  .site-header {
    min-height: 68px;
  }

  nav a:not(:last-child) {
    display: none;
  }

  h1 {
    font-size: clamp(4.7rem, 25vw, 7.2rem);
  }

  .hero-copy {
    padding-top: 56px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-art {
    min-height: 480px;
  }

  .section-heading {
    display: block;
  }

  .sync-state {
    margin-top: 22px;
  }

  .position-card {
    box-shadow: 7px 7px 0 var(--acid);
  }

  .trade-ledger {
    box-shadow: 7px 7px 0 var(--acid);
  }

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

  .metrics article {
    min-height: 145px;
  }

  .metrics article + article {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 0;
  }

  .position-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .trade-ledger-bar,
  .trade-ledger-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .trade-ledger-bar > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .trade-table {
    min-width: 0;
  }

  .trade-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .trade-table,
  .trade-table tbody,
  .trade-table tr,
  .trade-table td {
    display: block;
    width: 100%;
  }

  .trade-table tbody {
    padding: 0 18px;
  }

  .trade-table tbody tr {
    display: grid;
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    column-gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-table tbody tr:first-child {
    border-top: 0;
  }

  .trade-table td {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border: 0;
    white-space: normal;
  }

  .trade-table td:nth-child(even) {
    align-items: flex-end;
    text-align: right;
  }

  .trade-table td::before {
    color: #71736c;
    content: attr(data-label);
    font-size: 0.57rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .trade-table .trade-date,
  .trade-table td.trade-proof {
    align-items: flex-start;
    grid-column: 1 / -1;
    text-align: left;
  }

  .trade-table .trade-value,
  .trade-table td[data-label="Price"] {
    align-items: flex-start;
    text-align: left;
  }

  .trade-table td[data-label="Size"],
  .trade-table td[data-label="Role"] {
    align-items: flex-end;
    text-align: right;
  }

  .trade-table .trade-loading-row {
    display: block;
  }

  .trade-loading-row td {
    display: block;
    height: auto;
    padding: 58px 8px;
    text-align: center;
  }

  .trade-loading-row td::before {
    content: none;
  }

  .trade-ledger-footer button {
    width: 100%;
    min-height: 44px;
  }

  .contract-row {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .contract-row button {
    min-width: 70px;
  }

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

  .steps article {
    min-height: 210px;
  }

  .steps article + article {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .steps h3 {
    margin-top: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
