:root {
  --black: #050505;
  --ink: #f6f2e9;
  --muted: #9a9388;
  --red: #df2f28;
  --red-dark: #891b18;
  --green: #159763;
  --green-bright: #22c986;
  --panel: rgba(13, 13, 11, 0.84);
  --line: rgba(246, 242, 233, 0.16);
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --display: "Archivo Black", Impact, sans-serif;
  --body: "Space Grotesk", "Trebuchet MS", sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--black);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

#marketCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
}

.noise,
.flash,
.cursor-chart {
  position: fixed;
  pointer-events: none;
}

.noise {
  inset: 0;
  z-index: 5;
  opacity: 0.09;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 260 260' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

.flash {
  inset: 0;
  z-index: 4;
  opacity: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.75), transparent 36%),
    rgba(223, 47, 40, 0.18);
  transition: opacity 520ms var(--ease);
}

.cursor-chart {
  z-index: 10;
  width: 58px;
  height: 42px;
  translate: -50% -50%;
  mix-blend-mode: normal;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.7));
  transition: transform 180ms var(--ease), opacity 240ms var(--ease);
}

.cursor-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(105deg, rgba(223,47,40,0.22), rgba(21,151,99,0.22));
  border: 1px solid rgba(246, 242, 233, 0.36);
  transform: rotate(-7deg);
}

.cursor-line {
  position: absolute;
  left: 8px;
  top: 22px;
  z-index: 2;
  width: 43px;
  height: 14px;
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  transform: skewX(-24deg) rotate(-10deg);
}

.cursor-candle {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 2px;
  transform: rotate(-8deg);
}

.cursor-candle::before,
.cursor-candle::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 3px;
  height: 9px;
  background: var(--ink);
  translate: -50% 0;
}

.cursor-candle::before {
  top: -11px;
}

.cursor-candle::after {
  bottom: -11px;
}

.cursor-candle.red {
  left: 10px;
  top: 12px;
  background: var(--red);
}

.cursor-candle.green {
  left: 27px;
  top: 5px;
  height: 30px;
  background: var(--green);
}

.cursor-candle.small {
  left: 43px;
  top: 17px;
  height: 17px;
}

body:active .cursor-chart {
  transform: scale(0.86) rotate(8deg);
}

.gate-kicker,
.eyebrow,
.section-head p,
.nav a,
.sound-button,
.button,
.panel-bar,
.chart-readout,
.controls,
.stats,
footer,
.logo-caption {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.button,
.sound-button,
.controls button,
.ca-row button,
.meme-card {
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 520ms var(--ease), background 520ms var(--ease), border-color 520ms var(--ease), color 520ms var(--ease);
}

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 8;
  width: min(1180px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.74);
  backdrop-filter: blur(18px);
}

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

.brand-blob {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 47% 53% 48% 52%;
  background: linear-gradient(105deg, var(--red) 0 49%, var(--green) 50% 100%);
  border: 2px solid var(--ink);
  animation: wobble 6s var(--ease) infinite;
}

.brand-blob span {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0;
}

@keyframes wobble {
  0%, 100% { border-radius: 47% 53% 48% 52%; transform: rotate(-2deg); }
  50% { border-radius: 58% 42% 54% 46%; transform: rotate(2deg); }
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--display);
  letter-spacing: 0;
}

.brand-copy em {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  text-transform: lowercase;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
}

.nav a,
.sound-button {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.nav-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(246, 242, 233, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 520ms var(--ease), border-color 520ms var(--ease), background 520ms var(--ease);
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.nav-icon:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 242, 233, 0.54);
  background: rgba(255, 255, 255, 0.12);
}

.pump-icon {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(79, 223, 141, 0.48);
}

.pump-icon svg {
  width: 24px;
  height: 24px;
}

.sound-button {
  border-radius: 999px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.06);
}

.sound-button[aria-pressed="true"] {
  color: var(--green-bright);
  border-color: rgba(34, 201, 134, 0.7);
}

main,
footer {
  position: relative;
  z-index: 2;
}

.hero {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: 118px 24px 64px;
}

.hero-grid {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.78fr);
  gap: clamp(32px, 6vw, 92px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

h2,
h3,
p {
  margin-top: 0;
}

.hero h2,
.section-head h2,
.contract h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(56px, 9vw, 134px);
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h2 span {
  display: block;
  color: var(--red);
}

.lede {
  max-width: 720px;
  margin: 28px 0 34px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.36;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
}

.button.ghost {
  padding-right: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.button-dot {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.hero-logo {
  position: relative;
}

.paint-blob {
  transform-style: preserve-3d;
  transition: transform 220ms ease-out;
  filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.55));
}

.paint-blob svg {
  width: min(560px, 100%);
  overflow: visible;
}

.chart-strokes {
  animation: chartShake 1.8s steps(2, end) infinite;
}

.candles {
  animation: candlePulse 1.4s var(--ease) infinite alternate;
}

@keyframes chartShake {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -3px); }
}

@keyframes candlePulse {
  to { transform: translateY(-5px); }
}

.logo-caption {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, var(--red), var(--green));
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 24s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.ticker span {
  padding: 14px 26px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

.engine,
.narrative,
.memes,
.contract {
  padding: clamp(78px, 12vw, 160px) 24px;
}

.section-head {
  width: min(1180px, 100%);
  margin: 0 auto 30px;
}

.section-head p {
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 700;
}

.section-head h2,
.contract h2 {
  font-size: clamp(46px, 7vw, 96px);
}

.single-line-title {
  max-width: none;
}

@media (min-width: 981px) {
  .single-line-title {
    font-size: clamp(48px, 6vw, 84px);
    white-space: nowrap;
  }
}

@media (min-width: 768px) and (max-width: 980px) {
  .single-line-title {
    font-size: clamp(38px, 5.2vw, 48px);
    white-space: nowrap;
  }
}

.terminal-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 16px;
}

.market-panel,
.controls,
.cards article,
.contract-box {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.panel-bar span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
}

.panel-bar span:nth-child(2) {
  background: #eeb64c;
}

.panel-bar span:nth-child(3) {
  background: var(--green-bright);
}

.panel-bar strong {
  margin-left: auto;
  font-weight: 700;
}

#chartCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 1.875;
  background: rgba(0, 0, 0, 0.18);
}

.chart-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.chart-readout output {
  padding: 16px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  border-right: 1px solid var(--line);
}

.chart-readout output:last-child {
  border-right: 0;
}

.controls {
  padding: 18px;
}

.control-block {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.control-block label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.controls button {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.controls button:hover {
  transform: translateY(-2px);
  background: var(--red);
}

.stats {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
  font-size: 10px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 12px;
  background: rgba(0, 0, 0, 0.2);
}

.stats dt {
  color: var(--muted);
}

.stats dd {
  margin: 0;
  color: var(--green-bright);
  text-align: right;
}

.narrative {
  background: rgba(246, 242, 233, 0.04);
}

.cards {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.cards article {
  min-height: 280px;
  padding: clamp(22px, 3vw, 36px);
}

.cards span {
  display: inline-block;
  margin-bottom: 28px;
  padding: 7px 9px;
  background: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.cards article:nth-child(2) span {
  background: var(--green);
}

.cards h3 {
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cards p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.42;
}

.meme-wall {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.meme-card {
  min-height: 112px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 42px);
  line-height: 0.96;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.meme-card:nth-child(2),
.meme-card:nth-child(3) {
  transform: rotate(-1deg);
}

.meme-card:hover,
.meme-card.active {
  background: linear-gradient(105deg, var(--red), var(--green));
  transform: rotate(0deg) translateY(-4px);
}

.contract {
  background: var(--ink);
  color: var(--black);
}

.contract .eyebrow {
  color: var(--red);
}

.contract-box {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 90px);
  align-items: end;
  padding: clamp(24px, 4vw, 46px);
  background: rgba(5, 5, 5, 0.05);
  border-color: rgba(5, 5, 5, 0.2);
}

.contract-copy {
  color: rgba(5, 5, 5, 0.62);
  font-size: 18px;
  line-height: 1.45;
}

.ca-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--black);
}

.ca-row code {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  background: var(--black);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-row button {
  border: 0;
  padding: 0 22px;
  background: var(--red);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ca-row button:hover {
  background: var(--green);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 24px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
}

[data-reveal] {
  opacity: 0;
  translate: 0 28px;
  filter: blur(7px);
  transition: opacity 820ms var(--ease), translate 820ms var(--ease), filter 820ms var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .nav {
    display: none;
  }

  .hero-grid,
  .terminal-grid,
  .contract-box {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 112px;
  }

  .cards,
  .meme-wall {
    grid-template-columns: 1fr;
  }

  .meme-card:nth-child(2),
  .meme-card:nth-child(3) {
    transform: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    top: 10px;
    width: calc(100% - 20px);
  }

  .brand-copy em,
  .sound-button {
    display: none;
  }

  .hero,
  .engine,
  .narrative,
  .memes,
  .contract {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h2 {
    font-size: clamp(46px, 16vw, 78px);
  }

  .section-head h2,
  .contract h2 {
    font-size: clamp(40px, 13vw, 68px);
  }

  .chart-readout,
  .ca-row {
    grid-template-columns: 1fr;
  }

  .chart-readout output {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  [data-reveal] {
    opacity: 1;
    translate: 0 0;
    filter: none;
  }
}
