@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* Theme: change --bg and the rest follows */
  --bg: #ffffff;
  --fg: #000000;          /* text, lines */
  --border: #9a9a9a;
  --tile: #f0f0f0;        /* punk tile / highlight squares */
  --skin: #d9d9d9;        /* main punk skin */
  --skin-alt: #ffd100;    /* Credits yellow */
  --accent: #e4007c;      /* Credits magenta: burns, fire icon */
  --ink: #000000;         /* punk outlines, eyes */
  --primary: var(--fg);
  --primary-fg: var(--bg);
  --warning: #caf900;
  --green: #16a34a;
  --red: #dc2626;

  --font-mono: "Departure Mono", ui-monospace, monospace;
  --font-serif: "Pixelify Sans", "Departure Mono", monospace;
  --maxw: 72rem;
  --header-h: 5.25rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  transition: background .3s, color .3s;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
canvas { image-rendering: pixelated; }
mark { background: var(--fg); color: var(--bg); padding: 0 .2em; }

.mono { font-family: var(--font-mono); }
.muted { opacity: .75; }
.small { font-size: 12px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.label.strong { opacity: 1; }
.h-serif { font-family: var(--font-serif); font-weight: 700; letter-spacing: -.01em; margin: 0; }
.h-xl { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; }
.h-lg { font-size: 28px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
hr.dotted { border: 0; border-top: 2px dotted var(--border); margin: 0; }

/* Buttons */
.btn {
  font-family: var(--font-mono); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .15s;
  border: 0; position: relative;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-bottom-width: 2px; }
.btn-outline:hover { background: var(--fg); color: var(--bg); }
.btn-lg { height: 48px; padding: 0 16px; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--header-h);
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.header-row { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { height: 24px; width: auto; display: block; }
.logo-text { font-family: var(--font-serif); font-weight: 700; font-size: 20px; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 12px; }
.stat { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.stat-sep { border-right: 2px dotted var(--border); padding-right: 12px; }
.ticker { flex: 1; overflow: hidden; border-top: 1px solid var(--border); display: flex; align-items: center; font-size: 12px; }
.ticker-track { display: flex; gap: 40px; white-space: nowrap; animation: ticker 40s linear infinite; padding-left: 100%; }
.ticker-track span b { font-weight: normal; opacity: .7; margin-right: 6px; }
.up { color: var(--green); }
.down { color: var(--red); }
@keyframes ticker { to { transform: translateX(-100%); } }

/* Page rails */
.page { position: relative; padding-top: var(--header-h); }
.rails {
  position: absolute; inset: 0 4px; max-width: var(--maxw); margin: 0 auto;
  border-left: 2px dotted var(--border); border-right: 2px dotted var(--border); pointer-events: none;
}

/* Hero */
.hero { position: relative; max-width: var(--maxw); margin: 0 auto; overflow: hidden; background: var(--bg); }
.hero-wall { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.hero-tile { aspect-ratio: 1; background: var(--bg); }
.hero-tile > canvas, .hero-tile > img { display: block; width: 100%; height: 100%; image-rendering: pixelated; animation: tile-in .5s; }
@keyframes tile-in { from { opacity: 0; } }

/* Intro */
.intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; padding-top: 40px; padding-bottom: 40px; }
.intro-text { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 42rem; }
.intro-sub { margin: 0; line-height: 1.6; }
.intro-quote { margin: 0; }
.tagline { font-family: var(--font-serif); font-weight: 700; font-size: 24px; line-height: 1.25; max-width: 42rem; margin: 0; opacity: .9; }

/* Live */
.live { display: flex; align-items: center; gap: 24px; padding-top: 32px; padding-bottom: 32px; }
.live-left { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.live-mcap { display: flex; gap: 8px; }
.chains { margin: 0; }
.ca-box { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 529px; border: 2px dashed var(--border); border-radius: 6px; padding: 8px; }
.ca-dot { width: 8px; height: 8px; background: var(--green); flex-shrink: 0; animation: blink 1.4s steps(2) infinite; }
.ca-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
@keyframes blink { 50% { opacity: .2; } }
.link-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.link-row .btn { height: 40px; padding: 0 28px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding-bottom: 32px; }
.stat-cell { border: 2px solid var(--border); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-value { font-size: 26px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-cell .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grad { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.grad-bar { height: 12px; border: 2px solid var(--border); border-radius: 3px; overflow: hidden; }
.grad-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--fg) 0 6px, transparent 6px 8px); transition: width .6s; }

/* Vault */
.vault-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vault-stats > .vault-progress { grid-column: span 2; gap: 6px; }
.vault-stats > div { border: 2px solid var(--border); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vault-stats .h-serif { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-note { margin: 14px 0 18px; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding-bottom: 40px; }
.vault-card { border: 2px solid var(--border); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.vault-card > canvas, .vault-card > img { width: 100%; aspect-ratio: 1; background: var(--tile); border-radius: 0 !important; }
.vault-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vault-body .feed-title { max-width: 100%; }
.vrow { display: flex; justify-content: space-between; gap: 8px; width: 100%; font-size: 13px; }
.vault-empty { grid-column: 1 / -1; }

/* Activity */
.section-title { padding: 40px 0 24px; }
.activity { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding-bottom: 40px; }
.aum-card { position: relative; border: 1px solid var(--border); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-self: start; }
.aum-toggle { background: none; border: 0; color: inherit; display: flex; align-items: center; gap: 8px; padding: 0; cursor: pointer; text-align: left; }
.aum-value { font-size: 36px; }
.chev { transition: transform .2s; }
.aum-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.aum-breakdown { border-top: 2px dotted var(--border); padding-top: 8px; font-size: 13px; }
.aum-breakdown div { display: flex; justify-content: space-between; padding: 2px 0; }
.collection { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.collection canvas { width: 100%; aspect-ratio: 1; background: var(--tile); border-radius: 2px; }

.feed-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.feed li canvas { width: 56px; height: 56px; background: var(--tile); border-radius: 3px; }
.feed-top { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.feed-tag { background: var(--fg); color: var(--bg); padding: 0 6px; }
.feed-tag.sell { background: var(--green); color: var(--ink); }
.feed-tag.burn { background: var(--accent); color: var(--bg); }
.feed-title { font-family: var(--font-serif); font-weight: 700; font-size: 17px; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-title:hover { text-decoration: underline; }
.feed-time { font-size: 12px; opacity: .7; text-align: right; text-decoration: none; }
.feed li.feed-empty { display: block; }
.feed-empty { border: 2px dashed var(--border); border-radius: 6px; padding: 24px; text-align: center; opacity: .8; }
.more { align-self: center; }

/* How it works */
.how { display: flex; flex-direction: column; align-items: center; gap: 32px; padding-top: 56px; padding-bottom: 56px; }
.how-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.how-head h2, .how-head p { margin: 0; }
.wheel { position: relative; aspect-ratio: 1; width: 340px; max-width: 100%; }
.wheel-orbit { position: absolute; inset: 0; }
.orbit-tile { position: absolute; width: 20%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 1px solid var(--border); background: var(--bg); overflow: hidden; }
/* a Credit's grid fills the middle half of its image; zoom in on it */
.orbit-tile > canvas, .orbit-tile > img { display: block; width: 100%; height: 100%; image-rendering: pixelated; transform: scale(1.6); animation: tile-in .5s; }
.wheel-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.steps { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { border: 2px solid var(--border); border-radius: 6px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.step-top { display: flex; align-items: center; justify-content: space-between; }
.step-icon { width: 48px; height: 48px; }
.step-num { font-size: 14px; }
.steps h3 { font-size: 22px; margin: 0 0 6px; }
.steps p { margin: 0; }
.footnote { font-size: 12px; opacity: .7; margin-top: 4px !important; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
.reveal mark { background: transparent; color: inherit; transition: background .5s .4s, color .5s .4s; }
.reveal.in mark { background: var(--fg); color: var(--bg); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0 24px; position: relative; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-link, .footer-nav a { text-decoration: none; font-size: 14px; }
.footer-link { display: block; margin-top: 6px; }
.footer-link:hover, .footer-nav a:hover { text-decoration: underline; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 32px; font-size: 12px; opacity: .7; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 6px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) and (min-width: 769px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hide-sm { display: none !important; }
  .header-row { padding: 0 16px; }
  .header .logo-text { font-size: 16px; }
  .header .stat-sep { border-right: 0; padding-right: 0; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .live { flex-direction: column; align-items: stretch; }
  .activity { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats, .vault-stats { grid-template-columns: 1fr 1fr; }
  .hero-wall { grid-template-columns: repeat(4, 1fr); }
  .hero-tile:nth-child(n+13) { display: none; }
  .wheel { width: 260px; }
  .feed li { grid-template-columns: 44px 1fr; }
  .feed li canvas { width: 44px; height: 44px; }
  .feed-time { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
