/* JubJub — jubjub.fun
   White ground. Fraunces for display, Hanken Grotesk for reading.
   One accent (Zcash gold), used only where something happens. */

:root {
  --white: #ffffff;
  --ink: #141529;
  --ink-2: #3a3a4a;
  --muted: #6b6a78;
  --rule: #e4e4e9;
  --rule-strong: #cfcfd6;
  --paper: #f7f7f9;
  --gold: #f3b724;
  --gold-deep: #c98f00;
  --gold-soft: #fff4d1;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 48px);
  --step: clamp(40px, 6vw, 72px);

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--gold-deep); }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 4px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Type */
.display {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  letter-spacing: -0.015em;
  line-height: 1.02;
}
h1.display { font-size: clamp(2.9rem, 7.2vw, 5.6rem); }
h2.display { font-size: clamp(2rem, 3.6vw, 2.9rem); }
h3 { font-family: var(--body); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font: 500 1rem/1 var(--body);
  border-radius: 999px; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-gold:hover { background: #f6c23f; border-color: #f6c23f; color: var(--ink); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--rule-strong); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.94rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-row {
  display: flex; align-items: center; gap: 24px;
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 24; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.97rem; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  column-gap: var(--step);
  align-items: end;
}
.hero-copy { padding: clamp(56px, 8vw, 112px) 0 clamp(48px, 6vw, 88px); max-width: 620px; }
.lede { font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--ink-2); margin: 1.2em 0 1.6em; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }

.hero-art {
  margin: 0;
  align-self: stretch;
  justify-self: stretch;
  position: relative;
  min-height: 420px;
}
/* The picture is taken out of flow so the hero's height comes from the copy,
   and the bird simply fills that height, feet on the rule below. */
.hero-art picture {
  position: absolute;
  inset: clamp(24px, 4vw, 48px) 0 0 0;
  display: block;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 20px 30px rgba(20, 21, 41, 0.06));
}
.credit { font-size: 0.82rem; line-height: 1.45; color: var(--muted); margin: 10px 0 0; max-width: 34em; }

/* Contract address */
.ca {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px 12px;
  background: var(--white);
  max-width: 560px;
}
.ca-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.86rem; color: var(--muted); margin-bottom: 8px; }
.ca-label { color: var(--ink-2); font-weight: 500; }
.ca-row { display: flex; align-items: center; gap: 10px; }
.ca-value {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.95rem; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.copy {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  font: 500 0.9rem/1 var(--body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.copy:hover { border-color: var(--rule-strong); background: #f0f0f3; }
.copy .ico { width: 16px; height: 16px; }
.copy .ico-check { display: none; }
.copy.is-copied { background: var(--gold-soft); border-color: var(--gold); }
.copy.is-copied .ico-copy { display: none; }
.copy.is-copied .ico-check { display: block; }
.ca-note { margin: 10px 0 0; font-size: 0.84rem; color: var(--muted); }

.source { font-size: 0.92rem; color: var(--muted); margin-top: 28px; max-width: 34em; }
.source q { font-style: italic; color: var(--ink-2); }
.source q::before, .source q::after { content: none; }

/* Stats band */
.stats {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0 22px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px var(--step);
  margin: 0;
}
.stat dt { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.stat dd { margin: 0; }
.num {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 72;
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: opacity 320ms var(--ease-out);
}
.num.is-loading { opacity: 0.55; }
.stat-meta {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 0; font-size: 0.86rem; color: var(--muted);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rule-strong); flex: 0 0 auto;
  position: relative;
}
.stats.is-live .live-dot { background: var(--gold); }
.stats.is-live .live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: 0;
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  0% { transform: scale(0.5); opacity: 0.8; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

/* Sections */
.section { padding: var(--step) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--step);
  row-gap: 32px;
  align-items: start;
}
.section-head p { color: var(--ink-2); margin: 1em 0 0; max-width: 30em; font-size: 1.06rem; }
.section-head-wide { max-width: 40em; margin-bottom: 40px; }
.fine { font-size: 0.9rem; color: var(--muted); margin: 28px 0 0; max-width: 60em; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 0; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li > * { grid-column: 2; }
.steps li::before {
  grid-column: 1;
  grid-row: 1 / span 2;
  content: counter(step);
  font-family: var(--display);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 72;
  font-weight: 500;
  font-size: 2rem; line-height: 1; color: var(--ink);
  margin-top: -2px;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); max-width: 36em; }

/* Facts table */
.facts { width: 100%; border-collapse: collapse; font-size: 1rem; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 14px 0; border-top: 1px solid var(--rule); }
.facts tr:first-child th, .facts tr:first-child td { border-top: 0; padding-top: 0; }
.facts th { width: 34%; font-weight: 500; color: var(--muted); padding-right: 16px; }
.facts td { color: var(--ink); overflow-wrap: anywhere; }
.facts .mono { font-size: 0.9rem; }

/* Lore */
.lore { background: var(--white); }
.lore-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: var(--step);
  row-gap: 40px;
  align-items: start;
}
.timeline { display: grid; gap: 0; max-width: 760px; }
.timeline li {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 20px;
  padding: 28px 0; border-top: 1px solid var(--rule);
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline time {
  font-family: var(--display);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 72;
  font-weight: 500; font-size: 1.9rem; line-height: 1; color: var(--ink);
  margin-top: -3px;
}
.timeline h3 { margin-bottom: 8px; }
.timeline p { color: var(--ink-2); max-width: 36em; }
.timeline p:last-child { margin-bottom: 0; }
.timeline blockquote { margin: 14px 0 0; padding-left: 16px; border-left: 2px solid var(--gold); }
.timeline blockquote p { font-family: var(--display); font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 18; font-style: italic; font-size: 1.12rem; line-height: 1.45; color: var(--ink); margin: 0 0 8px; }
.timeline blockquote footer { font-size: 0.86rem; color: var(--muted); }
.timeline cite { font-style: normal; }

.curve {
  position: sticky; top: 92px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px clamp(20px, 3vw, 36px) 24px;
  max-width: 760px;
  background: var(--paper);
}
.curve h3 { font-family: var(--display); font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 48; font-weight: 500; font-size: 1.5rem; margin-bottom: 14px; }
.equation { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-style: italic; font-weight: 400; margin: 0 0 18px; letter-spacing: 0.01em; }
.equation sup { font-size: 0.6em; }
.math { font-style: italic; }
.curve-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 0 0 20px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.curve-facts div:last-child { grid-column: 1 / -1; }
.curve-facts dt { font-size: 0.86rem; color: var(--muted); margin-bottom: 3px; }
.curve-facts dd { margin: 0; font-size: 1rem; }
.scroll-x { display: block; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; font-size: 0.88rem; }
.curve p { color: var(--ink-2); max-width: 44em; }
.curve p:last-child { margin-bottom: 0; }

/* Buy */
.buy-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* Footer */
.footer { border-top: 1px solid var(--ink); padding: 40px 0 48px; font-size: 0.92rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px var(--step); }
.footer-about { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; max-width: 60em; }
.footer-about p { margin: 0; }
.footer-mark { width: 48px; height: 48px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: start; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-credit { grid-column: 1 / -1; margin: 0; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 0.84rem; }

/* Load moment: bird first, then the words. */
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { opacity: 0; transform: translateY(12px); animation: settle 900ms var(--ease-out) 80ms forwards; }
  .hero-copy > * { opacity: 0; animation: rise 640ms var(--ease-out) forwards; }
  .hero-copy > :nth-child(1) { animation-delay: 420ms; }
  .hero-copy > :nth-child(2) { animation-delay: 520ms; }
  .hero-copy > :nth-child(3) { animation-delay: 600ms; }
  .hero-copy > :nth-child(4) { animation-delay: 680ms; }
  .hero-copy > :nth-child(5) { animation-delay: 760ms; }
  .hero-copy > :nth-child(6) { animation-delay: 820ms; }
}
@keyframes settle { to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stats.is-live .live-dot::after { animation: none; }
  .btn, .copy, .num { transition: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 0.6fr); }
  .section-grid, .footer-grid, .lore-grid { grid-template-columns: minmax(0, 1fr); }
  .curve { position: static; }
  .section-head p { max-width: 40em; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-top: 40px; padding-bottom: 32px; max-width: none; }
  .hero-art { height: min(72vh, 520px); min-height: 360px; }
  .hero-art picture { inset: 8px 0 0 0; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
  .steps li { grid-template-columns: 40px minmax(0, 1fr); }
  .steps li::before { font-size: 1.6rem; }
  .timeline li { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .timeline time { font-size: 1.5rem; }
  .facts th { width: 38%; }
  .curve-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .ca-head { flex-direction: column; gap: 2px; }
  .ca-row { flex-wrap: wrap; }
  .ca-value { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
  .cta-row .btn { flex: 1 1 100%; }
  .curve-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 340px) {
  .stat-row { grid-template-columns: minmax(0, 1fr); }
}
