:root {
  --paper: #f7f3ea;
  --paper-deep: #efe8d8;
  --ink: #1c1917;
  --ink-soft: #3a342e;
  --maroon: #7c2a33;
  --maroon-deep: #5c1d25;
  --beanie: #c4b5a0;
  --pill: #e7e2d8;
  --line: rgba(28, 25, 23, 0.08);
  --shadow: rgba(28, 25, 23, 0.14);
  --display: "Caveat Brush", cursive;
  --hand: "Patrick Hand", cursive;
  --note: "Kalam", cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
a {
  font-family: inherit;
}

.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper);
}

.paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.paper-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 31px,
    var(--line) 32px
  );
  mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
}

.margin-rule {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52px;
  width: 2px;
  background: rgba(124, 42, 51, 0.18);
}

.ink-wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
}

.wash-a {
  width: 420px;
  height: 420px;
  background: #c4b5a0;
  top: -80px;
  right: -80px;
  animation: drift 18s ease-in-out infinite;
}

.wash-b {
  width: 360px;
  height: 360px;
  background: #7c2a33;
  bottom: 8%;
  left: -120px;
  opacity: 0.08;
  animation: drift 22s ease-in-out infinite reverse;
}

@keyframes drift {
  0%,
  100% { transform: translate(0, 0); }
  50% { transform: translate(24px, -18px); }
}

.scribble-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.doodles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.doodle {
  position: absolute;
  opacity: 0.14;
}

.d-1 {
  width: 72px;
  top: 22%;
  right: 3%;
  animation: floaty 9s ease-in-out infinite;
}

.d-2 {
  width: 64px;
  bottom: 16%;
  left: 4%;
  animation: floaty 11s ease-in-out infinite reverse;
}

.d-3 {
  width: 80px;
  top: 48%;
  left: 8%;
  animation: floaty 8s ease-in-out infinite;
}

.d-4 {
  width: 56px;
  top: 70%;
  right: 8%;
  animation: spin-slow 28s linear infinite;
}

@keyframes floaty {
  0%,
  100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

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

.nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(247, 243, 234, 0.86);
  border-bottom: 2px solid var(--ink);
  backdrop-filter: blur(8px);
  z-index: 20;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  padding: 8px 28px;
  box-shadow: 0 8px 0 rgba(28, 25, 23, 0.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.nav-brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 4px;
  animation: bob 3.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-family: var(--note);
  position: relative;
}

.nav-links a:not(.btn):not(.nav-icon)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--maroon);
  transition: width 0.25s ease;
}

.nav-links a:not(.btn):not(.nav-icon):hover::after {
  width: 100%;
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-icon img {
  width: 16px;
  height: 16px;
}

.nav-icon:hover {
  transform: rotate(-8deg) scale(1.06);
  background: var(--pill);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
}

.ticker {
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-deep);
  padding: 8px 0;
}

.ticker-track {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-family: var(--note);
  font-size: 1.05rem;
}

.tick-dot {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--maroon);
}

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

.hero {
  padding: 48px 24px 24px;
}

.hero-panel {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  padding: 40px 40px 36px;
  background: rgba(255, 252, 246, 0.72);
  position: relative;
}

.tape {
  position: absolute;
  width: 84px;
  height: 22px;
  background: rgba(196, 181, 160, 0.55);
  transform: rotate(-8deg);
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.12);
}

.tape-tl { top: 10px; left: 18px; }
.tape-tr { top: 14px; right: 22px; transform: rotate(7deg); }

.sketch-frame {
  border: 3px solid var(--ink);
  border-radius: 3px 10px 4px 8px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.sketch-frame:hover {
  transform: rotate(-0.4deg) translateY(-3px);
  box-shadow: 8px 8px 0 var(--ink);
}

.kicker {
  margin: 0 0 8px;
  font-family: var(--note);
  font-size: 1.5rem;
}

.name-pill {
  display: inline-block;
  padding: 0 0.35em;
  background: var(--pill);
  border-radius: 6px;
  box-shadow: 1px 2px 0 rgba(28, 25, 23, 0.12);
  font-weight: 700;
  animation: pill-pop 4.5s ease-in-out infinite;
}

@keyframes pill-pop {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
}

h1 .line-draw {
  display: block;
}

h1 .accent {
  color: var(--maroon);
}

.symbol {
  margin: 0 0 16px;
  font-family: var(--note);
  font-size: 1.35rem;
}

.lead {
  margin: 0 0 24px;
  max-width: 34ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 2.5px solid var(--ink);
  border-radius: 4px 12px 5px 9px;
  text-decoration: none;
  font-family: var(--note);
  font-weight: 700;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-sm { padding: 6px 12px; font-size: 1rem; }
.btn-lg { padding: 14px 22px; font-size: 1.35rem; }

.btn-maroon {
  background: var(--maroon);
  color: #f7f3ea;
  border-color: var(--maroon-deep);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}

.btn-outline {
  background: transparent;
}

.btn-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn-logo.ink,
img.ink {
  filter: brightness(0) saturate(100%);
}

.btn-maroon .btn-logo {
  background: #f7f3ea;
  border-radius: 6px;
  padding: 1px;
}

.ca-box {
  border: 2px dashed var(--ink);
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
}

.ca-label {
  display: block;
  font-size: 0.95rem;
  font-family: var(--note);
  margin-bottom: 4px;
}

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

.ca-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--hand);
  font-size: 1rem;
}

.btn-copy {
  border: 2px solid var(--ink);
  background: var(--pill);
  font-family: var(--note);
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.btn-copy.copied {
  background: #d7e8d4;
}

.chain-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 1.05rem;
}

.chain-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.hero-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-orbit {
  position: absolute;
  width: 320px;
  height: 320px;
  border: 2px dashed rgba(28, 25, 23, 0.18);
  border-radius: 50%;
  animation: spin-slow 36s linear infinite;
}

.logo-frame {
  position: relative;
  padding: 10px;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  animation: tilt 6s ease-in-out infinite;
}

@keyframes tilt {
  0%,
  100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.4deg); }
}

.hero-logo {
  width: min(360px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
}

.caption {
  margin: 12px 0 0;
  font-family: var(--note);
  font-size: 1rem;
  opacity: 0.7;
}

.section {
  padding: 72px 24px;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.95;
}

.title-scribble {
  display: block;
  width: min(280px, 70%);
  height: 16px;
  margin-top: 2px;
}

.title-scribble path {
  fill: none;
  stroke: var(--maroon);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
}

.reveal.in .title-scribble path {
  animation: draw 1.1s ease forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.section-sub {
  margin: 0 0 28px;
  max-width: 40ch;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.about-card,
.tweet-card {
  padding: 26px;
  background: rgba(255, 252, 246, 0.78);
}

.about-lead {
  font-family: var(--note);
  font-size: 1.45rem;
  margin-top: 0;
}

.about-end {
  font-family: var(--display);
  font-size: 2.2rem;
  color: var(--maroon);
  margin-bottom: 0;
}

.tweet-label {
  margin: 0 0 12px;
  font-family: var(--note);
}

.tweet-embed {
  min-height: 220px;
}

.tweet-embed .twitter-tweet {
  margin: 0 auto !important;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  padding: 18px;
  text-align: center;
  background: rgba(255, 252, 246, 0.7);
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 3rem;
  line-height: 1;
  color: var(--maroon);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step {
  padding: 20px 16px 18px;
  background: rgba(255, 252, 246, 0.76);
  position: relative;
}

.step-num {
  position: absolute;
  top: -12px;
  left: 14px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--maroon);
  color: #f7f3ea;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.3rem;
}

.step-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin: 10px 0 8px;
}

.step-logo {
  border: 2px solid var(--ink);
  border-radius: 4px;
  object-fit: cover;
}

.step h3 {
  margin: 0 0 8px;
  font-family: var(--note);
  font-size: 1.35rem;
}

.step p {
  margin: 0;
  font-size: 1.05rem;
}

.howto-cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.chart-frame {
  position: relative;
  background: #fff;
  min-height: 620px;
  overflow: hidden;
}

.chart-frame iframe {
  width: 100%;
  height: 640px;
  border: 0;
  background: #fff;
}

.chart-corners::before,
.chart-corners::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid var(--maroon);
  pointer-events: none;
}

.chart-corners::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.chart-corners::after {
  bottom: 8px;
  right: 8px;
  border-left: 0;
  border-top: 0;
}

.banner-frame {
  padding: 14px 14px 8px;
  background: #fff;
  margin: 0 0 28px;
}

.banner-ratio {
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: #fff;
}

.banner-ratio img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.banner-frame figcaption {
  text-align: center;
  font-family: var(--display);
  font-size: 1.8rem;
  padding: 8px 0 4px;
  color: var(--maroon);
}

.join-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  text-decoration: none;
  background: rgba(255, 252, 246, 0.8);
  font-family: var(--note);
  font-size: 1.3rem;
}

.join-card img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.join-card:hover {
  background: #fff;
}

.footer {
  border-top: 3px solid var(--ink);
  padding: 32px 24px 48px;
  text-align: center;
}

.footer-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 2px solid var(--ink);
  margin: 0 auto 10px;
  animation: bob 3.6s ease-in-out infinite;
}

.sign {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--maroon);
}

.reveal {
  opacity: 0;
  transform: translateY(22px) rotate(-0.6deg);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  .hero-panel,
  .about-grid,
  .steps,
  .stat-row,
  .join-links {
    grid-template-columns: 1fr 1fr;
  }

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

  .margin-rule { left: 18px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 16px;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
  }

  .nav-links.open { display: flex; }

  .hero-panel,
  .about-grid,
  .steps,
  .stat-row,
  .join-links {
    grid-template-columns: 1fr;
  }

  .hero-panel { padding: 28px 18px; }
  .logo-orbit { width: 240px; height: 240px; }
  .d-1, .d-2 { opacity: 0.08; }
  .chart-frame iframe { height: 520px; }
}
