/* ==========================================================================
   TopSure design system
   Shared by every page. Page-specific styles live in small <style> blocks
   or page CSS files; everything reusable belongs here.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #0E1620;
  --ink-2: #141F2B;
  --ink-3: #1C2834;
  --ink-4: #25313D;
  --line-dark: #2A3642;
  --paper: #F3F1EA;
  --paper-2: #EAE7DD;
  --white: #FFFFFF;
  --lime: #E4FF3A;
  --lime-soft: rgba(228, 255, 58, .14);
  --lime-glow: rgba(228, 255, 58, .45);
  --slate: #3A4654;
  --muted: #5A6673;
  --grey: #8A97A5;
  --mist: #C9CFD6;
  --mist-2: #9AA5B1;
  --line: #DAD6CA;
  --line-2: #E5E1D6;
  --warn: #FFB547;
  --ok: #7BE495;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --gutter: 24px;
  --max: 1240px;
  --section-y: clamp(72px, 10vw, 128px);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-card: 0 1px 0 rgba(14, 22, 32, .04), 0 12px 32px -16px rgba(14, 22, 32, .18);
  --shadow-float: 0 30px 60px -30px rgba(0, 0, 0, .55);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; }

:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-light :focus-visible, .section--paper :focus-visible, .section--white :focus-visible, .section--lime :focus-visible {
  outline-color: var(--ink);
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--lime); color: var(--ink); padding: 12px 18px;
  border-radius: var(--r-pill); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 480px) { :root { --gutter: 16px; } }

.section { padding: var(--section-y) 0; position: relative; }
.section--tight { padding: clamp(56px, 7vw, 88px) 0; }
.section--dark { background: var(--ink); color: var(--paper); }
.section--ink2 { background: var(--ink-2); color: var(--paper); }
.section--white { background: var(--white); }
.section--paper { background: var(--paper); }
.section--lime { background: var(--lime); color: var(--ink); }

.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap, 24px); }
.row--center { align-items: center; }
.row--end { align-items: flex-end; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 var(--basis, 420px); min-width: 0; }

.grid { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 260px)), 1fr)); }
.split { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: center; }
.split--top { align-items: start; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono); font-weight: 500; font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; opacity: .7; }
.section--dark .eyebrow, .section--ink2 .eyebrow { color: var(--lime); }
.section--lime .eyebrow { color: var(--ink); }

.display {
  font-family: var(--font-display); font-weight: 900; font-stretch: 78%; font-variation-settings: "wdth" 78;
  font-size: clamp(50px, 7.4vw, 108px); line-height: .9; letter-spacing: -.02em;
  text-transform: uppercase;
}
.h1 {
  font-family: var(--font-display); font-weight: 900; font-stretch: 80%; font-variation-settings: "wdth" 80;
  font-size: clamp(34px, 4.6vw, 64px); line-height: .95; letter-spacing: -.015em;
  text-transform: uppercase;
}
.h2 {
  font-family: var(--font-display); font-weight: 800; font-stretch: 85%; font-variation-settings: "wdth" 85;
  font-size: clamp(30px, 3.8vw, 52px); line-height: 1; letter-spacing: -.02em;
}
.h3 { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.h4 { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--slate); max-width: 62ch; }
.section--dark .lead, .section--ink2 .lead { color: var(--mist); }
.body-muted { color: var(--slate); }
.section--dark .body-muted, .section--ink2 .body-muted, .card--dark .body-muted, .card--ink3 .body-muted { color: var(--mist); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.lime { color: var(--lime); }
.on-lime-hl { background: var(--lime); color: var(--ink); padding: 0 .12em; }
.fineprint { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.section--dark .fineprint, .section--ink2 .fineprint { color: var(--mist-2); }

.section-head { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: space-between; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head > :first-child { flex: 1 1 560px; min-width: 0; }
.section-head > :last-child:not(:first-child) { flex: 1 1 320px; min-width: 0; }
.section-head .h1, .section-head .h2 { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; background: none;
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lg { min-height: 56px; padding: 16px 30px; font-size: 17px; }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--lime:hover { background: #F0FF7A; }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--ink-4); }
.btn--ghost { border-color: #4A5664; color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn svg { flex: none; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 22, 32, .86);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  color: var(--paper); border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__word { font-family: var(--font-display); font-weight: 900; font-stretch: 112%; font-size: 22px; letter-spacing: -.02em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px;
  border-radius: var(--r-pill); color: var(--mist); text-decoration: none; font-size: 14.5px;
  transition: color .15s, background-color .15s;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--paper); background: rgba(255, 255, 255, .06); }
.nav__cta { display: flex; align-items: center; gap: 10px; }
.nav__toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid #3A4654;
  background: none; cursor: pointer; align-items: center; justify-content: center;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--paper); position: relative; transition: transform .2s, background-color .2s;
}
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink); border-bottom: 1px solid var(--line-dark);
    padding: 12px var(--gutter) 24px; display: none;
  }
  .nav__menu.is-open { display: block; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__links a { min-height: 48px; font-size: 17px; border-radius: 12px; }
  .nav__cta--desktop { display: none; }
  .nav__menu .nav__cta { margin-top: 12px; }
}
@media (min-width: 1081px) {
  .nav__menu { display: flex; align-items: center; gap: 20px; }
  .nav__menu .nav__cta { display: none; }
}

/* ---------- Cards ---------- */
.card { background: var(--white); border-radius: var(--r-lg); padding: clamp(22px, 2.6vw, 32px); position: relative; }
.card--paper { background: var(--paper); }
.card--dark { background: var(--ink); color: var(--paper); }
.card--ink3 { background: var(--ink-3); color: var(--paper); border: 1px solid var(--line-dark); }
.card--lime { background: var(--lime); color: var(--ink); }
.card--line { background: transparent; border: 1.5px solid var(--line); }
.section--dark .card--line, .section--ink2 .card--line { border-color: var(--line-dark); }
.card--flex { display: flex; flex-direction: column; gap: 14px; }
.card__icon {
  width: 48px; height: 48px; border-radius: 14px; background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; color: var(--lime); flex: none;
}
.card--dark .card__icon, .card--ink3 .card__icon { background: var(--lime); color: var(--ink); }
.card--lift { transition: transform .25s var(--ease), box-shadow .25s; }
.card--lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }

/* ---------- Chips / tags / status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: var(--r-pill); font-weight: 600; font-size: 15px;
  border: 1.5px solid var(--line); background: transparent;
}
.section--dark .chip, .section--ink2 .chip, .card--dark .chip { border-color: #3A4654; }
.chip--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip--lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; border: 1.5px solid currentColor; white-space: nowrap;
}
.tag--lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.tag--muted { color: var(--muted); }
.section--dark .tag--muted, .card--dark .tag--muted, .card--ink3 .tag--muted { color: var(--mist-2); }
.tag--warn { color: var(--ink); background: var(--warn); border-color: var(--warn); }

.demo-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--warn); color: var(--ink); font-family: var(--font-mono); font-size: 11.5px;
  font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}

.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); position: relative; flex: none; display: inline-block; }
.status-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--lime); opacity: 0; animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Key/value lists (wallet, pass) ---------- */
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-dark); }
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--mist-2); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.kv--light > div { border-color: var(--line-2); }
.kv--light dt { color: var(--muted); }

/* ---------- Steps ---------- */
.steps { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.step { border-top: 3px solid var(--ink); padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.section--dark .step, .section--ink2 .step { border-color: #3A4654; }
.step__n { font-family: var(--font-display); font-weight: 900; font-size: 48px; line-height: 1; }
.step--hl { border-color: var(--lime) !important; }

/* ---------- Flow diagram (vertical) ---------- */
.flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.flow__node {
  border-radius: var(--r-md); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink-3); border: 1px solid var(--line-dark); color: var(--paper);
}
.flow__node--hl { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.flow__node--light { background: var(--white); color: var(--ink); border-color: var(--line); }
.flow__arrow { height: 34px; display: flex; justify-content: center; position: relative; }
.flow__arrow::before { content: ""; width: 2px; background: linear-gradient(var(--grey), var(--grey)) center / 2px 100% no-repeat; }
.flow__arrow::after {
  content: ""; position: absolute; left: 50%; top: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--lime); animation: travel 1.8s linear infinite;
}
@keyframes travel { from { top: 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } to { top: calc(100% - 6px); opacity: 0; } }
.flow__label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }

/* ---------- Tooltip (details-based, keyboard accessible) ---------- */
.explainer { display: inline-block; position: relative; }
.explainer summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px;
  min-height: 44px;
}
.explainer summary::-webkit-details-marker { display: none; }
.explainer__q {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-family: var(--font-mono); text-decoration: none;
}
.explainer__body {
  margin-top: 8px; max-width: 460px; padding: 18px 20px; border-radius: var(--r-md);
  background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55; box-shadow: var(--shadow-float);
}

/* ---------- Phone mockup ---------- */
.phone {
  width: min(100%, 340px); margin: 0 auto; border-radius: 44px; padding: 12px;
  background: #05090D; box-shadow: var(--shadow-float), inset 0 0 0 1.5px #2A3642;
}
.phone__screen { border-radius: 34px; overflow: hidden; background: var(--ink-2); color: var(--paper); min-height: 560px; position: relative; }
.phone__notch { width: 110px; height: 28px; border-radius: 0 0 16px 16px; background: #05090D; margin: 0 auto; }

/* ---------- Code ---------- */
.code {
  background: #0A1118; color: #D7DEE5; border: 1px solid var(--line-dark); border-radius: var(--r-md);
  padding: 20px 22px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  overflow-x: auto; white-space: pre; tab-size: 2;
}
.code .k { color: var(--lime); }
.code .s { color: #9FE3C1; }
.code .n { color: #FFC98A; }
.code .c { color: #6F7D8B; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--mist); padding: 72px 0 40px; border-top: 8px solid var(--lime); }
.footer__top { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; }
.footer__brand { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; color: var(--paper); }
.footer__cols { flex: 2 1 520px; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.footer__col h2 { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--mist-2); margin-bottom: 14px; }
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.footer__col a { color: var(--paper); text-decoration: none; display: inline-flex; min-height: 36px; align-items: center; }
.footer__col a:hover { color: var(--lime); }
.footer__legal { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; font-size: 13px; line-height: 1.6; color: var(--mist-2); }
.footer__legal p { max-width: 760px; }

/* ---------- Reveal motion ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .08s; }
.js .reveal[data-delay="2"] { transition-delay: .16s; }
.js .reveal[data-delay="3"] { transition-delay: .24s; }
.js .reveal[data-delay="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.section--dark .divider { background: var(--line-dark); }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
