/* $APE — black and white, nothing else. */

@font-face {
  font-family: "ComicNeue";
  src: url("assets/ComicNeueSansID.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #fff;
  --dim: #8b8b8b;
  --rule: #242424;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 24px;
}

.mark {
  width: min(210px, 46vw);
  height: auto;
  display: block;
  margin: 0 0 46px;
}

/* a 48-character address, so it runs far smaller than a wordmark would and
   is allowed to break mid-string rather than overflow on narrow screens */
.wordmark {
  margin: 0;
  max-width: 100%;
  line-height: 1.2;
}

.ca {
  position: relative;
  font-family: "ComicNeue", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(8.5px, 1.9vw, 20px);
  letter-spacing: .01em;
  line-height: 1.3;
  padding: 6px 4px;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  word-break: break-all;
  color: var(--fg);
  transition: color .18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.ca:hover,
.ca:focus-visible { color: var(--dim); }

/* The confirmation is painted over the address rather than replacing it: the
   span only goes invisible, so it keeps its box and the hero can't reflow
   between a 48-character address and the word "Copied!". */
.ca.is-copied .ca-text { visibility: hidden; }

.ca.is-copied::after {
  content: attr(data-msg);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  letter-spacing: .06em;
}

/* long enough that wide tracking would hurt it, so keep it readable */
.tagline {
  margin: 28px auto 0;
  font-size: clamp(12px, 1.8vw, 15px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dim);
}

.actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 160px;
  padding: 13px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--fg);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover,
.btn:focus-visible { background: var(--fg); color: var(--bg); }

.btn.is-flash { background: var(--fg); color: var(--bg); }

.btn svg { width: 14px; height: 14px; flex: none; }

/* ---------- sections ---------- */

section { padding: 110px 0; border-top: 1px solid var(--rule); }

h2 {
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 44px;
}

p { margin: 0 0 24px; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

.dim { color: var(--dim); }

/* ---------- parameters ---------- */

dl.params { margin: 0; }

dl.params > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
dl.params > div:first-child { border-top: 1px solid var(--rule); }

dl.params dt {
  color: var(--dim);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

dl.params dd { margin: 0; text-align: right; white-space: nowrap; }

.genesis {
  margin-top: 46px;
  padding: 28px 24px;
  border: 1px solid var(--rule);
  text-align: center;
}
.genesis span {
  display: block;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

/* ---------- thread ---------- */

.post { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.post:first-of-type { border-top: 1px solid var(--rule); }

.post b {
  display: block;
  font-weight: 400;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: .1em;
  margin-bottom: 12px;
}

.post p { margin: 0 0 14px; }
.post p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

footer { padding: 84px 0 104px; border-top: 1px solid var(--rule); text-align: center; }

footer .sym {
  font-size: 12px;
  letter-spacing: .34em;
  color: var(--dim);
  margin: 0 0 20px;
  max-width: none;
}

footer p {
  margin: 0 auto;
  max-width: 48ch;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.75;
}

@media (max-width: 600px) {
  section { padding: 80px 0; }
  dl.params > div { flex-direction: column; gap: 2px; }
  dl.params dd { text-align: left; }
}

/* ---------- lightspeed ---------- */

#lightspeed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;   /* clicks fall through to .hero, which drives it */
}

/* hero content rides above the streaks */
.hero > *:not(#lightspeed):not(.scrolldown) { position: relative; z-index: 1; }

/* ---------- thread / post extras ---------- */

.stamp {
  margin: -28px 0 34px;
  font-size: 12px;
  letter-spacing: .1em;
  color: #5c5c5c;
}

.attach {
  margin: 26px 0 30px;
  padding: 24px;
  border: 1px solid var(--rule);
  display: inline-block;
  text-align: center;
}
.attach img { display: block; width: 150px; height: auto; }
.attach figcaption {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.close { color: var(--fg); }

.post b span {
  float: right;
  color: #5c5c5c;
  letter-spacing: .06em;
  font-size: 12px;
}

/* replies from the thread author sit indented under the post */
.post .op {
  margin-top: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
  color: var(--dim);
}
.post .op span {
  color: var(--fg);
  margin-right: 10px;
  letter-spacing: .06em;
}

@media (max-width: 600px) {
  .post b span { float: none; display: block; margin-top: 4px; }
  .attach { display: block; }
  .attach img { margin: 0 auto; }
}

/* ---------- scroll indicator ---------- */

.scrolldown {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 2;
  padding: 12px;
  line-height: 0;
  color: var(--dim);
  transition: opacity .4s ease, color .2s ease, visibility .4s;
  animation: nudge 2.4s ease-in-out infinite;
}

.scrolldown:hover,
.scrolldown:focus-visible { color: var(--fg); }

.scrolldown svg { width: 26px; height: auto; display: block; }

/* once they've taken the hint, get out of the way */
.scrolldown.hide { opacity: 0; visibility: hidden; }

/* the -50% lives in the keyframes: transform can't be split across
   a base rule and an animation on the same element */
@keyframes nudge {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

@media (prefers-reduced-motion: reduce) {
  .scrolldown { animation: none; transform: translateX(-50%); }
}

@media (max-width: 600px) {
  .scrolldown { bottom: 18px; }
  .scrolldown svg { width: 22px; }
}

.footlink { margin: 0 0 22px; max-width: none; }
.footlink a {
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}
.footlink a:hover { border-bottom-color: var(--fg); }

@media (max-width: 600px) {
  .ca { padding: 6px 0; }
}
