/* Pairpad. Greyscale, sentence case, one hairline down the middle of everything.
   The page is two lanes: what happens on Robinhood Chain (left) and what happens on the far
   chain (right). Every section is a row across both. */

:root {
  /* light theme: --ink is the page ground, --white is the strong colour (dark green) */
  --ink: #ffffff;
  --body: #0c0c0c;
  --mid: #3c3c3c;
  --dim: #6b6b6b;
  --faint: #b9c6ba;
  --line: #e2e2e2;
  --panel: #f6f8f6;
  --chip: #eef3ee;
  --white: #004008;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --rail: 5.6rem;
  --gutter: clamp(1.6rem, 4vw, 5.6rem);
  --max: 132rem;
}

html { font-size: 62.5%; background: var(--ink); color-scheme: light; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 1.6rem/1.5 var(--text);
  color: var(--body);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--white); color: var(--ink); }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: 0; }
.dim { color: var(--dim); }
.mid { color: var(--mid); }
[hidden] { display: none !important; }

/* ground */
#ground { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.page { position: relative; z-index: 1; }

/* header: square chips, brand left, actions right */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1.6rem var(--gutter);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.chips { display: flex; gap: 1px; }
.chip {
  display: inline-flex; align-items: center; gap: .8rem;
  min-height: 4.4rem; padding: 0 1.6rem;
  background: var(--ink); color: var(--body); border: 1px solid var(--line); margin-left: -1px;
  font-size: 1.4rem; letter-spacing: -.005em;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.chip:hover, .chip[aria-current] { background: var(--white); color: var(--ink); }
.chip.brand { font-family: var(--display); font-weight: 500; font-size: 1.8rem; color: var(--white); background: transparent; padding-left: 0; }
.chip.brand img { width: 3rem; height: 3rem; }
.chip.brand:hover { background: transparent; color: var(--white); }
.chip .xi { width: 1.6rem; height: 1.6rem; }
.chip .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--dim); }
.chip .dot.on { background: var(--white); }

/* the lanes */
.lanes {
  display: grid;
  grid-template-columns: 1fr var(--rail) 1fr;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.lane { min-width: 0; }
.rail { position: relative; }
.rail::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: var(--line); transform: translateX(-.5px);
}
.rail .node {
  position: absolute; left: 50%; top: 0; width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--dim); transform: translate(-50%, 0);
  transition: background .4s, border-color .4s;
}
.row.lit .rail .node { background: var(--white); border-color: var(--white); }

/* hero */
.hero { min-height: 100svh; display: grid; align-content: end; padding-top: 12rem; padding-bottom: 4rem; }
.hero .lanes { align-items: end; row-gap: 3.2rem; }
.hero .headline {
  grid-column: 1 / -1;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(4.2rem, 7.4vw, 9.6rem); line-height: .92; letter-spacing: -.02em;
  color: var(--white); margin: 0; max-width: 21ch;
}
.hero .headline .grey { color: var(--dim); }
.lanehead {
  font-size: 1.3rem; color: var(--dim); letter-spacing: .01em;
  display: flex; align-items: baseline; gap: 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line);
}
.lanehead b { color: var(--body); font-weight: 500; }
.lane.right .lanehead { justify-content: flex-end; text-align: right; }
.hero .lead { font-size: 1.8rem; line-height: 1.45; color: var(--mid); max-width: 42ch; margin: 0; }
.lane.right .lead { margin-left: auto; text-align: right; }
.hero .rail { min-height: 22rem; }
.hero .rail .node { top: auto; bottom: 0; }

/* the message: a dot that crosses the rail. CSS only, never a rAF loop */
.crossing { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.crossing i {
  position: absolute; left: 0; top: 0; width: .7rem; height: .7rem; margin: -.35rem; border-radius: 50%;
  background: var(--white); opacity: 0;
  animation: cross 4.8s cubic-bezier(.6, 0, .3, 1) infinite;
}
.crossing i:nth-child(2) { animation-delay: 2.4s; animation-name: crossBack; }
@keyframes cross {
  0% { transform: translateX(min(22vw, 26rem)); opacity: 0; }
  8% { opacity: 1; }
  45% { transform: translateX(0); opacity: 1; }
  55% { transform: translateX(0); opacity: 1; }
  92% { transform: translateX(max(-22vw, -26rem)); opacity: 1; }
  100% { transform: translateX(max(-22vw, -26rem)); opacity: 0; }
}
@keyframes crossBack {
  0% { transform: translateX(max(-22vw, -26rem)); opacity: 0; }
  8% { opacity: 1; }
  45% { transform: translateX(0); opacity: 1; }
  55% { transform: translateX(0); opacity: 1; }
  92% { transform: translateX(min(22vw, 26rem)); opacity: 1; }
  100% { transform: translateX(min(22vw, 26rem)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .crossing i { animation: none; opacity: .6; } }

/* live strip under the hero */
.strip {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 0 3.2rem; row-gap: .8rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line);
  font-size: 1.3rem; color: var(--dim);
}
.strip span b { color: var(--body); font-weight: 500; }
.strip .mono { color: var(--mid); }

/* rows */
.rows { padding: 8rem 0 4rem; }
.row .lanes { padding-top: 6.4rem; padding-bottom: 6.4rem; }
.row h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.8rem, 3.6vw, 4.2rem); line-height: 1; letter-spacing: -.02em;
  color: var(--white); margin: 0 0 2rem; max-width: 13ch;
}
.lane.right h2 { margin-left: auto; }
.row p { margin: 0; color: var(--dim); max-width: 46ch; font-size: 1.6rem; line-height: 1.55; transition: color .5s; }
.row p + p { margin-top: 1.2rem; }
.row.lit p { color: var(--mid); }
.row.lit p.primary { color: var(--body); }
.lane.right p { margin-left: auto; text-align: right; }
.lane.right h2 { text-align: right; }
.row .quiet h2 { color: var(--faint); }
.row.lit .quiet h2 { color: var(--dim); }

/* arrows across the rail: a line that draws in when the row is lit */
.rail .arrow { position: absolute; top: 13rem; left: -3rem; height: 1px; width: 0; background: var(--white); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.rail .arrow.toLeft { right: -3rem; left: auto; }
.row.lit .rail .arrow { width: calc(100% + 6rem); }
.rail .arrow::after {
  content: ""; position: absolute; top: -.35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--white);
  opacity: 0; transition: opacity .3s .5s;
}
.rail .arrow.toLeft::after { left: -.35rem; }
.rail .arrow:not(.toLeft)::after { right: -.35rem; }
.row.lit .rail .arrow::after { opacity: 1; }
.arrowLabel { position: absolute; top: 14.4rem; left: 50%; transform: translateX(-50%); font-size: 1.1rem; color: var(--dim); white-space: nowrap; }

/* worked example: a receipt */
.receipt {
  margin-top: 2.4rem; border-top: 1px solid var(--line); max-width: 46ch;
}
.lane.right .receipt { margin-left: auto; }
.receipt div { display: flex; justify-content: space-between; gap: 2rem; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: 1.4rem; color: var(--dim); }
.receipt div b { color: var(--body); font-weight: 500; font-family: var(--mono); font-feature-settings: "tnum" 1; }
.receipt div.total { color: var(--body); }

/* live figures */
.figure { font-family: var(--mono); font-size: 1.4rem; color: var(--body); }
.figure small { color: var(--dim); font-family: var(--text); font-size: 1.3rem; }
.live { display: grid; gap: .6rem; margin-top: 2rem; max-width: 46ch; }
.lane.right .live { margin-left: auto; }
.live div { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line); padding-top: .8rem; font-size: 1.4rem; color: var(--dim); }
.live div b { font-family: var(--mono); color: var(--body); font-weight: 500; }
.live div b.ok::after { content: " ✓"; color: var(--mid); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .8rem;
  min-height: 4.4rem; padding: 0 2rem; background: var(--white); color: var(--ink);
  font-size: 1.4rem; font-weight: 500; letter-spacing: -.005em;
  transition: background .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--body); }
.btn.ghost { background: var(--chip); color: var(--body); }
.btn.ghost:hover { background: var(--white); color: var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.actions { display: flex; gap: 1px; flex-wrap: wrap; margin-top: 2.4rem; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 8rem; padding: 4rem 0 3rem; }
.foot .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.2rem; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.foot dl { margin: 0; font-size: 1.3rem; }
.foot dt { color: var(--dim); margin-top: 1.2rem; }
.foot dd { margin: .2rem 0 0; color: var(--mid); }
.foot dd.mono { overflow-wrap: anywhere; }
.foot .mark { display: none; }
.foot .note { max-width: var(--max); margin: 2rem auto 0; padding: 0 var(--gutter); font-size: 1.3rem; color: var(--dim); }

/* small screens: lanes stack, the rail becomes a left rule */
@media (max-width: 760px) {
  :root { --rail: 2.4rem; }
  .lanes { grid-template-columns: var(--rail) 1fr; row-gap: 3.2rem; }
  .row .quiet { padding-top: .8rem; }
  .lane.left { grid-column: 2; }
  .lane.right { grid-column: 2; }
  .lane.right .lanehead, .lane.right .lead, .lane.right p, .lane.right h2, .lane.right .receipt, .lane.right .live { text-align: left; margin-left: 0; justify-content: flex-start; }
  .rail { grid-column: 1; grid-row: 1 / span 2; }
  .hero .headline { grid-column: 1 / -1; }
  .strip { grid-column: 1 / -1; }
  .rail .arrow, .arrowLabel, .crossing { display: none; }
  .foot .cols { grid-template-columns: 1fr; }
  .top { padding: 1.2rem; }
  .chip { padding: 0 1.2rem; font-size: 1.3rem; }
}
