:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --mute: #5f5f5f;
  --soft: #f4f4f2;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --line: #0a0a0a;
  --pad: clamp(16px, 4vw, 56px);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.section.dark :focus-visible, .marquee :focus-visible { outline-color: var(--paper); }
h1, h2, h3, .logo, .big { font-family: var(--display); }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); }
.tiny { font-size: 13px; color: var(--mute); margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 18px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1.5px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 23px; letter-spacing: -.04em; text-decoration: none; line-height: 1; }
.logo .mark { width: 15px; height: 19px; flex: none; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.logo:hover .mark { transform: translateY(3px) scale(1.12); }
.nav nav { display: flex; gap: 22px; align-items: center; font-size: 15px; font-weight: 500; }
.nav nav a { text-decoration: none; }
.nav nav a:not(.pill) { position: relative; }
.nav nav a:not(.pill)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav nav a:not(.pill):hover::after { transform: scaleX(1); }
.pill { border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 16px; transition: background .15s, color .15s; }
.pill:hover { background: var(--ink); color: var(--paper); }
/* Follow on X: the solid pill, inverts on hover */
.pill.x { display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; }
.pill.x svg { width: 14px; height: 14px; flex: none; }
.pill.x:hover { background: var(--paper); color: var(--ink); }
.footer .pill.x { margin-top: 18px; font-size: 15px; }

/* HERO */
.hero {
  position: relative; overflow-x: clip;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px;
  padding: clamp(32px, 6vw, 80px) var(--pad) 48px;
  align-items: center;
  min-height: calc(100vh - 62px);
  background-image: radial-gradient(rgba(10,10,10,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -11px -11px;
}
.hero h1 {
  font-size: clamp(60px, 9.6vw, 150px);
  line-height: .88; letter-spacing: -.055em; font-weight: 700; margin: 0 0 28px;
}
/* Each word is an outline. A drop falls into it, liquid rises (Trade, Drip, Repeat in turn), holds, drains, loops.
   The fill is two wave tiles clipped to the text: a solid front wave and a translucent back wave that leads it
   and scrolls the other way. background-position-y sets the level (0% empty, 100% full), -x scrolls the waves. */
.hero h1 { --cycle: 9s; }
.hero h1 .line { position: relative; display: inline-block; }
.hero h1 .w {
  display: inline-block;
  padding-bottom: .14em; margin-bottom: -.14em; /* keep the descenders inside the fill */
  color: transparent; -webkit-text-stroke: 2.5px var(--ink);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 100 Q25 93 50 100 T100 100 T150 100 T200 100 V200 H0Z' fill='%230a0a0a'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='none'%3E%3Cpath d='M0 100 Q50 90 100 100 T200 100 V200 H0Z' fill='%230a0a0a' fill-opacity='.22'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 1.4em 200%, 2.3em 200%;
  background-position: 0 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  animation: fill-word var(--cycle) .7s infinite both, wave 2.4s linear infinite;
}
/* the drop that sets each word off (on the wrapper: background-clip: text would hide it inside .w) */
.hero h1 .line::before {
  content: ""; position: absolute; left: 46%; top: -.2em;
  width: .16em; height: .21em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -16 24 37'%3E%3Cpath d='M0,-16 C9,-3 12,4 12,9 A12,12 0 1 1 -12,9 C-12,4 -9,-3 0,-16 Z' fill='%230a0a0a'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  animation: drop-in var(--cycle) .7s infinite both;
}
.hero h1 .line:nth-of-type(2) .w, .hero h1 .line:nth-of-type(2)::before { animation-delay: 1.6s, 0s; }
.hero h1 .line:nth-of-type(3) .w, .hero h1 .line:nth-of-type(3)::before { animation-delay: 2.5s, 0s; }
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-.25em) scale(.4, .4); animation-timing-function: cubic-bezier(.3, 0, .6, .4); }
  2% { opacity: 1; transform: translateY(-.2em) scale(.85, 1.05); animation-timing-function: cubic-bezier(.55, 0, .9, .5); }
  8% { opacity: 1; transform: translateY(.62em) scale(.75, 1.3); }
  9.5% { opacity: 0; transform: translateY(.72em) scale(1.6, .3); }
  100% { opacity: 0; transform: translateY(.72em) scale(1.6, .3); }
}
@keyframes fill-word {
  0%, 8.5% { background-position-y: 0%, 0%; animation-timing-function: cubic-bezier(.3, .1, .3, 1); }
  15% { background-position-y: 46%, 62%; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  27%, 68% { background-position-y: 100%, 100%; animation-timing-function: cubic-bezier(.6, 0, .4, 1); }
  77% { background-position-y: 42%, 56%; animation-timing-function: cubic-bezier(.5, 0, .6, 1); }
  86%, 100% { background-position-y: 0%, 0%; }
}
@keyframes wave { to { background-position-x: 1.4em, -2.3em; } }
.hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .07s; }
.hero-copy > :nth-child(3) { animation-delay: .14s; }
.hero-copy > :nth-child(4) { animation-delay: .21s; }
.hero-copy > :nth-child(5) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.lede { font-size: clamp(18px, 1.6vw, 21px); max-width: 32em; margin: 0 0 30px; color: #222; }
.lede strong { background: linear-gradient(transparent 62%, rgba(10,10,10,.14) 62%); font-weight: 600; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 14px 28px; border: 1.5px solid var(--ink); border-radius: 999px;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(10,10,10,.9); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--paper); color: var(--ink); }
.btn:not(.solid):hover { background: var(--ink); color: var(--paper); }

.hero-art {
  position: relative; order: -1; aspect-ratio: 480 / 460;
  width: calc(100% + var(--pad)); margin-left: calc(var(--pad) * -1); max-width: 760px; justify-self: start;
  animation: enter-left .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes enter-left { from { opacity: 0; transform: translateX(-60px); } }
.faucet { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; }

/* Pepe leaning on the wall: flush with the right screen edge, flipped so the wall is on the right.
   multiply blends the video's white background into the page. */
.hero-copy { position: relative; z-index: 1; }
.pepe-wall { position: absolute; right: 0; bottom: 0; z-index: 0; height: min(64%, 620px); aspect-ratio: 1244 / 1664; pointer-events: none; mix-blend-mode: multiply; }
.pepe-wall video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%); mask-image: linear-gradient(to bottom, transparent 0, #000 14%); }
/* keep the copy and faucet clear of Pepe on wide screens */
@media (min-width: 981px) { .hero { padding-right: calc(var(--pad) + clamp(0px, 17vw, 300px)); } }

/* drops — animation cycle  2.6s, staggered */
.drop { transform: translate(350px, 214px); opacity: 0; animation: fall 2.6s cubic-bezier(.5, 0, 1, .6) infinite; }
.drop.d2 { animation-delay: .87s; }
.drop.d3 { animation-delay: 1.73s; }
@keyframes fall {
  0%   { transform: translate(350px, 214px) scale(.2); opacity: 0; }
  12%  { transform: translate(350px, 222px) scale(1); opacity: 1; }
  80%  { transform: translate(350px, 410px) scale(1); opacity: 1; }
  82%  { opacity: 0; }
  100% { transform: translate(350px, 410px) scale(1); opacity: 0; }
}
.flow { animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.lever { transform-origin: 175px 62px; animation: lever 2.6s ease-in-out infinite; }
@keyframes lever { 0%, 100% { transform: rotate(7deg); } 12% { transform: rotate(-6deg); } 70% { transform: rotate(-6deg); } }
.bead { transform-origin: 350px 212px; animation: bead 2.6s ease-in infinite; }
@keyframes bead { 0% { transform: scale(0); opacity: 1; } 10% { transform: scale(.4, .3); } 70% { transform: scale(1, 1.2); opacity: 1; } 78%, 100% { transform: scale(1.1, 1.6) translateY(6px); opacity: 0; } }
.ring { transform-origin: 350px 424px; opacity: 0; animation: ripple 2.6s ease-out infinite; }
.ring.r2 { animation-delay: .87s; }
.ring.r3 { animation-delay: 1.73s; }
@keyframes ripple {
  0%, 78% { transform: scale(.3); opacity: 0; }
  80% { opacity: 1; }
  100% { transform: scale(3.6); opacity: 0; }
}

/* MARQUEE */
.marquee { border-block: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); overflow: hidden; }
.track { display: flex; gap: 40px; width: max-content; padding: 14px 0; animation: scroll 30s linear infinite; }
.track span { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: .1em; white-space: nowrap; }
.track span::after { content: "◆"; margin-left: 40px; font-size: 10px; vertical-align: 2px; }
@keyframes scroll { to { transform: translateX(-33.333%); } }

/* SECTIONS */
.section { padding: clamp(56px, 9vw, 120px) var(--pad); }
.section h2 { font-size: clamp(36px, 5.6vw, 80px); line-height: .96; letter-spacing: -.045em; font-weight: 700; margin: 0 0 24px; max-width: 14em; }
.eyebrow::before { content: ""; display: inline-block; width: 22px; height: 1.5px; background: currentColor; vertical-align: 4px; margin-right: 10px; }
.sub { max-width: 38em; font-size: 19px; margin: 0 0 40px; color: #333; }
.section.dark { background: var(--ink); color: var(--paper); }
.section.dark .sub, .section.dark .tiny { color: #c4c4c4; }

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--ink); }
.steps li { padding: 28px 24px 34px; border-right: 1.5px solid var(--ink); transition: background .2s, color .2s; }
.steps li:hover { background: var(--ink); color: var(--paper); }
.steps li:hover .num { background: var(--paper); color: var(--ink); }
.steps li:hover a { color: var(--paper); }
.steps li:last-child { border-right: 0; }
.steps h3 { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin: 18px 0 10px; line-height: 1.1; }
.steps p { margin: 0; font-size: 16px; }
.num { display: inline-block; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--paper); padding: 3px 9px; border-radius: 999px; transition: background .2s, color .2s; }

.formula { margin-top: 32px; padding: 28px; border: 1.5px dashed var(--ink); background: var(--soft); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.eq { font-size: clamp(14px, 2vw, 22px); font-weight: 700; margin: 0 0 10px; overflow-wrap: anywhere; }
.eq span { border-bottom: 3px solid var(--ink); }
.note { margin: 0; color: var(--mute); }

/* SIM */
.sim { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.sim label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.sim input[type=number] {
  font: 700 22px var(--mono); padding: 14px; color: var(--paper); background: transparent;
  border: 1.5px solid var(--paper); border-radius: 0; width: 100%;
  transition: background .15s;
}
.sim input[type=number]:hover { background: rgba(255,255,255,.06); }
.sim input[type=number]:focus { outline: 3px solid var(--paper); outline-offset: 3px; }
.sim small { font-weight: 400; color: #bdbdbd; font-size: 13px; }
.sim .check { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; font-weight: 500; }
.sim .check input { width: 20px; height: 20px; accent-color: #fff; }
.result { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--paper); }
.result > div { padding: 24px; }
.result > div:first-child { border-right: 1.5px solid var(--paper); }
.big { font-size: clamp(36px, 7vw, 96px); font-weight: 700; letter-spacing: -.05em; line-height: 1; margin: 0; overflow-wrap: anywhere; }
.result .label { color: #c4c4c4; }

/* CREW */
.crew { position: relative; margin: 0; border: 4px solid var(--ink); box-shadow: 14px 14px 0 var(--ink); }
.crew video { width: 100%; height: auto; display: block; background: var(--ink); }
.sound {
  position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px; border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease;
}
.sound svg { width: 20px; height: 20px; }
.sound:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper); }
.sound .waves { display: none; }
.sound[aria-pressed="true"] .waves { display: block; }
.sound[aria-pressed="true"] .slash { display: none; }

/* FACTS */
.facts { margin: 40px 0 0; border-top: 1.5px solid var(--ink); }
.facts > div { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 20px 12px; border-bottom: 1.5px solid var(--ink); transition: background .15s; }
.facts > div:hover { background: var(--soft); }
.facts dt { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.facts dd { margin: 0; font-weight: 500; }

/* FOOTER */
.footer { border-top: 1.5px solid var(--ink); padding: 40px var(--pad) 56px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; }
.footer .tiny { margin-top: 12px; }

/* SCROLL REVEAL (enabled by script.js) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: 0; max-width: 600px; }
  .pepe-wall { position: relative; height: auto; width: min(58%, 360px); justify-self: end; margin-right: calc(var(--pad) * -1); margin-top: -24px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(-n+2) { border-bottom: 1.5px solid var(--ink); }
  .sim { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav nav a:not(.pill) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .steps li:last-child { border-bottom: 0; }
  .result { grid-template-columns: 1fr; }
  .result > div:first-child { border-right: 0; border-bottom: 1.5px solid var(--paper); }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .hero h1 .w { -webkit-text-stroke-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drop, .ring, .track, .hero-copy > *, .flow, .lever, .bead { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .drop.d1 { opacity: 1; transform: translate(350px, 300px); }
  /* static: Trade. and Drip. filled, Repeat. outlined */
  .hero h1 .w { animation: none; background-position-y: 100%, 100%; }
  .hero h1 .line::before { display: none; }
  .hero h1 .line:nth-of-type(3) .w { background-image: none; }
}
