/*
 * PayGate — the public page.
 *
 * Direction: the clearing room. Intaglio ink-green ground, brass for the part
 * that moves, mint only where something is verified. Type does three jobs:
 * Plex Sans for the machine speaking, Plex Mono for anything that is data, and
 * Plex Serif italic for the one phrase that is paper rather than metal.
 *
 * The signature is the filament: a single brass thread that enters the hero,
 * crosses the gate, and continues down the left edge as scroll progress.
 */

@font-face {
  font-family: "Plex Sans";
  src: url("fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Serif";
  src: url("fonts/plex-serif-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ink: #07110e;
  --ink-2: #0a1713;
  --ink-3: #0e1f19;

  --line: rgba(233, 239, 231, 0.1);
  --line-2: rgba(233, 239, 231, 0.18);

  --paper: #f2ecdd;
  --paper-2: #e7dfcd;
  --paper-ink: #13211b;
  --paper-muted: #5c6a61;

  --brass: #d8a44a;
  --brass-bright: #e8bb6a;
  --mint: #7ce0be;
  --rust: #c96a4a;

  --text: #e9efe7;
  --body: rgba(233, 239, 231, 0.76);
  --muted: #8fa39a;
  --dim: #6c8078;

  --sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Plex Serif", Georgia, "Times New Roman", serif;

  --wrap: 1160px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(216, 164, 74, 0.075), transparent 62%),
    var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection {
  background: rgba(216, 164, 74, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  padding: 10px 14px;
  border-radius: 6px;
}

.wrap {
  width: min(var(--wrap), 100% - 64px);
  margin-inline: auto;
}

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

.thread {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 60;
  pointer-events: none;
  background: rgba(233, 239, 231, 0.05);
}

.thread-fill,
.thread-bead { display: none; }

.thread::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--progress, 0) * 100%);
  background: linear-gradient(180deg, var(--brass) 0%, var(--brass) 62%, var(--mint) 100%);
  opacity: 0.85;
}

.thread-bead {
  position: absolute;
  display: block;
  left: -2px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--brass-bright);
  box-shadow: 0 0 14px rgba(216, 164, 74, 0.8);
  top: calc(var(--progress, 0) * 100%);
}

@media (max-width: 900px) {
  .thread { display: none; }
}

/* --- header ---------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 220ms ease, border-color 220ms ease;
}

.top.is-scrolled {
  background: rgba(7, 17, 14, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.top-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* The official wordmark, and nothing beside it: no glyph, no tile. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text);
}

.brand-logo {
  height: 21px;
  width: auto;
  flex: none;
  display: block;
}

.top-nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 26px;
  font-size: 13.5px;
  color: var(--body);
}

.top-nav a {
  position: relative;
  padding: 4px 0;
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.top-nav a:hover { color: var(--text); }
.top-nav a:hover::after { transform: scaleX(1); }

/* --- buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 19px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.btn-solid {
  background: var(--brass);
  color: #1a1206;
}
.btn-solid:hover {
  background: var(--brass-bright);
  transform: translateY(-1px);
}

.btn-line {
  border-color: var(--line-2);
  color: var(--text);
}
.btn-line:hover {
  border-color: rgba(216, 164, 74, 0.55);
  color: var(--brass-bright);
}

.btn-ghost {
  padding: 8px 14px;
  border-color: var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--body);
}
.btn-ghost:hover {
  border-color: rgba(216, 164, 74, 0.6);
  color: var(--brass-bright);
}

.arrow-down {
  font-size: 12px;
  opacity: 0.6;
  transition: transform 200ms ease;
}
.btn-line:hover .arrow-down { transform: translateY(2px); }

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

.hero {
  padding: clamp(56px, 8vw, 104px) 0 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 4.35vw, 3.5rem);
  line-height: 0.97;
  letter-spacing: -0.038em;
  font-weight: 600;
}

.hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--brass);
}

.lede {
  max-width: 47ch;
  margin: 26px 0 0;
  font-size: clamp(15px, 1.1vw, 16.5px);
  line-height: 1.72;
  color: var(--body);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 0;
  margin: 54px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.facts > div {
  padding-right: clamp(20px, 3vw, 38px);
}

.facts > div + div {
  padding-left: clamp(20px, 3vw, 38px);
  border-left: 1px solid var(--line);
}

.facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0;
  color: var(--dim);
}

.facts dd {
  margin: 7px 0 0;
  font-size: 19px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-art {
  margin: 0;
  position: relative;
}

.art {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.hero-art .art {
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.45));
}

.hero-art figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0;
  color: var(--dim);
  text-align: right;
}

.lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.01em;
  fill: var(--muted);
}
.lbl.dim { fill: var(--dim); }
.lbl.mint { fill: var(--mint); }

/* stroke draw ------------------------------------------------------------- */

.art .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.art-gate .d1 { animation: draw 1.9s cubic-bezier(0.22, 0.7, 0.22, 1) 0.1s forwards; }
.art-gate .d2 { animation: draw 1.9s cubic-bezier(0.22, 0.7, 0.22, 1) 0.45s forwards; }

.art-gate .filament {
  animation: draw 1.5s cubic-bezier(0.22, 0.7, 0.22, 1) 1.5s forwards;
}

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

.verify {
  opacity: 0;
  animation: verifyPulse 7s ease-in-out 2s infinite;
  transform-origin: 300px 214px;
}

@keyframes verifyPulse {
  0%, 8% { opacity: 0; }
  16%, 30% { opacity: 1; }
  42%, 100% { opacity: 0.35; }
}

/* hero copy entrance ------------------------------------------------------ */

.hero-copy > * {
  animation: rise 800ms cubic-bezier(0.22, 0.7, 0.22, 1) both;
}
.hero-copy > h1 { animation-delay: 80ms; }
.hero-copy > .lede { animation-delay: 180ms; }
.hero-copy > .actions { animation-delay: 260ms; }
.hero-copy > .facts { animation-delay: 340ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

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

.section-head {
  max-width: 720px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.5vw, 2.85rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
  font-weight: 600;
}

.section-note {
  max-width: 52ch;
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
}

/* --- stack (paper) --------------------------------------------------------- */

.stack {
  margin-top: clamp(64px, 8vw, 110px);
  padding: clamp(64px, 8vw, 108px) 0;
  background: var(--paper);
  color: var(--paper-ink);
  border-top: 1px solid rgba(19, 33, 27, 0.14);
  border-bottom: 1px solid rgba(19, 33, 27, 0.14);
}

.stack h2 {
  color: var(--paper-ink);
}

.stack .section-note {
  color: var(--paper-muted);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(40px, 6vw, 88px);
  margin-top: clamp(36px, 4vw, 52px);
}

.stack-card {
  padding: 24px 0 30px;
  border-top: 1px solid rgba(19, 33, 27, 0.2);
}

.stack-card h3 {
  margin: 0 0 10px;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.stack-card p {
  margin: 0;
  max-width: 44ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(19, 33, 27, 0.76);
}

/* --- paths and steps -------------------------------------------------------- */

.path-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--paper-ink);
  border-bottom: 1px solid rgba(19, 33, 27, 0.35);
  transition: color 180ms ease, border-color 180ms ease;
}

.path-cta:hover {
  color: #8a5a12;
  border-bottom-color: rgba(138, 90, 18, 0.6);
}

.steps {
  padding: clamp(64px, 8vw, 108px) 0;
  border-bottom: 1px solid var(--line);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(36px, 4vw, 52px);
}

.step-list li {
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}

.step-list span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brass);
}

.step-list h3 {
  margin: 12px 0 10px;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.step-list p {
  max-width: 40ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--body);
}

.step-list code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--brass);
}

.steps-note {
  max-width: 60ch;
  margin: 44px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.steps-note a {
  color: var(--brass);
  border-bottom: 1px solid rgba(216, 164, 74, 0.4);
}

.steps-note a:hover { color: var(--brass-bright); }

@media (max-width: 720px) {
  .step-list { grid-template-columns: 1fr; gap: 28px; }
}

/* --- start ----------------------------------------------------------------- */

.start {
  padding: clamp(72px, 9vw, 118px) 0;
}

.start-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
}

.start-inner h2 {
  margin: 0;
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  line-height: 1.07;
  letter-spacing: -0.032em;
  font-weight: 600;
}

.start-inner p {
  max-width: 52ch;
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--body);
}

.start-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.start-inner .ai-note {
  max-width: 52ch;
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--dim);
}

.start-inner .ai-note a {
  color: var(--muted);
  border-bottom: 1px solid rgba(233, 239, 231, 0.18);
}

.start-inner .ai-note a:hover { color: var(--brass-bright); }


.stack-card code {
  font-family: var(--mono);
  font-size: 0.88em;
  letter-spacing: -0.01em;
  color: rgba(19, 33, 27, 0.9);
  background: rgba(19, 33, 27, 0.07);
  padding: 1px 4px;
  border-radius: 3px;
}

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

.foot {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 5vw, 64px) 0 28px;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  gap: clamp(28px, 4vw, 60px);
}

.foot-brand p {
  max-width: 42ch;
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.foot-head {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.foot-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--body);
}

.foot-nav a:hover { color: var(--brass-bright); }

.foot-base {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  color: var(--dim);
}

.foot-base p { margin: 0; }

/* --- responsive ------------------------------------------------------------ */

@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: 2; max-width: 560px; }
  .hero-art figcaption { text-align: left; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .top-nav { display: none; }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 36px;
    padding-top: 0;
    border-top: 0;
  }
  .facts > div {
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .facts > div + div { padding-left: 0; border-left: 0; }
  .facts dd { font-size: 16px; }
  .stack-grid { grid-template-columns: minmax(0, 1fr); }
  .stack-card { padding: 20px 0 24px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .art .draw,
  .sig {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .verify { opacity: 1; transform: none; }
  .arm { transform: rotate(-34deg); }
  .pulse { opacity: 0; }
  .sig { stroke-dashoffset: 0; }
  .stamp,
  .stamp-tick { opacity: 1; transform: none; }
  .packets > g { opacity: 1; }
  .thread::before { height: 0; }
  .thread-bead { display: none; }
}
