/* =============================================================
   FIN — Shared Design System
   One file, every page. Single source of truth for tokens,
   type, spacing, motion, and shared components.
   ============================================================= */

/* ------- Reset ------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ------- Tokens ------- */
:root {
  /* Color — single dark editorial system */
  --ink:        #0a0a0a;       /* near-black bg */
  --ink-1:      #131313;       /* surface raised */
  --ink-2:      #1c1c1c;       /* surface card */
  --ink-3:      #2a2a2a;       /* hairline on dark */
  --paper:      #f5f3ee;       /* warm paper for light surfaces */
  --paper-pure: #ffffff;
  --bone:       #e8e3d8;       /* subtle warm fill */
  --cream:      #d4c6a8;       /* the one accent — warm, restrained */
  --cream-soft: rgba(212, 198, 168, 0.18);
  --line-dark:  rgba(255, 255, 255, 0.08);
  --line-light: rgba(10, 10, 10, 0.08);
  --text-dark:  #0a0a0a;
  --text-light: #f5f3ee;
  --muted-dark: rgba(10, 10, 10, 0.55);
  --muted-light:rgba(245, 243, 238, 0.62);

  /* Type */
  --display: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --sans:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing scale — 4-based, used everywhere */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 144px;

  /* Layout */
  --container: 1280px;
  --gutter:    32px;
  --radius:    20px;
  --radius-sm: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-1: 200ms;
  --t-2: 450ms;
  --t-3: 800ms;
}

/* ------- Type ------- */
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-light);
  background: var(--ink);
}

.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
}
.lede {
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--muted-light);
  text-wrap: pretty;
  max-width: 56ch;
}
.h1 { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 7vw, 96px); letter-spacing: -0.04em; line-height: 0.95; text-transform: uppercase; }
.h2 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 4.4vw, 64px); letter-spacing: -0.035em; line-height: 1.0; text-transform: uppercase; text-wrap: balance; }
.h3 { font-family: var(--sans); font-weight: 500; font-size: clamp(20px, 1.6vw, 24px); letter-spacing: -0.01em; line-height: 1.25; }
.body { font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--muted-light); text-wrap: pretty; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-light); }

/* Light surfaces invert text vars */
.surface-light {
  background: var(--paper);
  color: var(--text-dark);
}
.surface-light .lede,
.surface-light .body { color: var(--muted-dark); }
.surface-light .label { color: var(--muted-dark); }

/* ------- Layout ------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--s-9) 0; }
.section-tight { padding: var(--s-8) 0; }
.section-loose { padding: var(--s-10) 0; }

.stack > * + * { margin-top: var(--s-5); }
.stack-sm > * + * { margin-top: var(--s-3); }
.stack-lg > * + * { margin-top: var(--s-7); }

/* ------- Nav ------- */
nav.fin-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--s-6); height: 64px;
  background: #000;
  border-bottom: 1px solid transparent;
  transition: height var(--t-2) var(--ease), border-color var(--t-2) ease;
}
nav.fin-nav > .fin-logo { justify-self: start; }
nav.fin-nav > .fin-nav-links { justify-self: center; }
nav.fin-nav > .fin-nav-cta { justify-self: end; }
nav.fin-nav > .fin-nav-actions {
  justify-self: end;
  display: inline-flex; align-items: center; gap: 12px;
}
nav.fin-nav .fin-nav-demo {
  display: inline-flex; align-items: center;
  padding: 9px 16px;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-light);
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  background: rgba(255,255,255,0.04);
  transition: background var(--t-1) ease, color var(--t-1) ease, border-color var(--t-1) ease;
}
nav.fin-nav .fin-nav-demo:hover {
  background: var(--cream); color: var(--ink); border-color: var(--cream);
}
nav.fin-nav .fin-nav-demo.is-current {
  background: var(--cream); color: var(--ink); border-color: var(--cream);
}
nav.fin-nav.is-scrolled {
  height: 56px;
  background: #000;
  border-bottom-color: var(--line-dark);
}
nav.fin-nav.on-light {
  background: rgba(245, 243, 238, 0.78);
  border-bottom-color: var(--line-light);
}
nav.fin-nav.on-light .fin-logo,
nav.fin-nav.on-light .fin-nav-link { color: var(--text-dark); }

.fin-logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 900;
  font-size: 18px; letter-spacing: 0.02em;
  color: var(--text-light);
  text-transform: uppercase;
}
.fin-logo .logo-star { font-size: 22px; color: var(--text-light); line-height: 1; }
.fin-logo .logo-text { font-size: 20px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-light); text-transform: uppercase; }
.fin-nav-links {
  display: flex; align-items: center; gap: var(--s-7);
  list-style: none;
}
.fin-nav-link {
  font-size: 13px; font-weight: 500; color: var(--text-light);
  letter-spacing: 0.01em;
  opacity: 0.78;
  transition: opacity var(--t-1) ease;
}
.fin-nav-link:hover { opacity: 1; }
.fin-nav-link.is-current { opacity: 1; }
.fin-nav-link.is-current::after {
  content: ""; display: block; height: 1px; background: var(--cream);
  margin-top: 4px;
}

/* Right side cluster */
.fin-nav-cta {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 8px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.04);
  transition: background var(--t-1) ease, border-color var(--t-1) ease;
}
.fin-nav-cta:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }

/* ------- Buttons ------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 14px 22px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  border-radius: 999px;
  transition: background var(--t-1) ease, color var(--t-1) ease, border-color var(--t-1) ease, transform var(--t-1) ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--cream); color: var(--ink); }
.btn-primary:hover { background: var(--paper); }
.btn-ghost { border-color: var(--line-dark); color: var(--text-light); }
.btn-ghost:hover { border-color: var(--cream); color: var(--cream); }
.surface-light .btn-ghost { border-color: rgba(10,10,10,0.18); color: var(--text-dark); }
.surface-light .btn-ghost:hover { border-color: var(--ink); }

.btn-arrow svg { transition: transform var(--t-1) ease; }
.btn-arrow:hover svg { transform: translateX(3px); }

/* ------- Footer ------- */
.fin-footer {
  background: var(--ink);
  color: var(--text-light);
  border-top: 1px solid var(--line-dark);
  padding: var(--s-9) 0 var(--s-7);
}
.fin-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--s-7);
  align-items: start;
}
.fin-footer h5 {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: var(--s-4);
}
.fin-footer ul { list-style: none; }
.fin-footer li + li { margin-top: 10px; }
.fin-footer a {
  font-size: 14px;
  color: var(--text-light);
  opacity: 0.7;
  transition: opacity var(--t-1) ease, color var(--t-1) ease;
}
.fin-footer a:hover { opacity: 1; color: var(--cream); }
.fin-footer-mark {
  font-family: var(--display);
  font-size: 28px; font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-light);
  display: flex; align-items: baseline; gap: 6px;
}
.fin-footer-mark .accent { color: var(--cream); }
.fin-footer-tag {
  margin-top: var(--s-4);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted-light);
  max-width: 28ch;
}
.fin-footer-bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-dark);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-light);
  gap: var(--s-5); flex-wrap: wrap;
}
.fin-footer .footer-live {
  font-family: var(--sans); font-size: 14px;
  color: #6ee787; opacity: 0.9; text-transform: none; letter-spacing: 0;
}
.fin-footer .footer-soon {
  font-family: var(--sans); font-size: 14px;
  color: rgba(245,243,238,0.4); text-transform: none; letter-spacing: 0;
}
.fin-footer-disclaimer {
  text-transform: none !important;
  letter-spacing: 0.04em !important;
  color: rgba(245,243,238,0.32) !important;
  font-size: 11px;
}

/* ============================================================
   RESPONSIVE — nav + global
   ============================================================ */

/* Tablet & narrow laptop: tighten nav padding, smaller link gap */
@media (max-width: 1080px) {
  nav.fin-nav { padding: 0 24px; }
  .fin-nav-links { gap: var(--s-5); font-size: 12.5px; }
  .fin-nav-actions { gap: 8px; }
  .fin-nav-actions .fin-nav-cta,
  .fin-nav-actions .fin-nav-demo {
    padding: 7px 12px;
    font-size: 11px;
  }
}

/* Tablet portrait & below: hide center links, keep CTA cluster */
@media (max-width: 900px) {
  .fin-nav-links { display: none; }
  nav.fin-nav { grid-template-columns: 1fr auto; }
  nav.fin-nav > .fin-nav-actions,
  nav.fin-nav > .fin-nav-cta { justify-self: end; }
  .fin-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .fin-footer-grid > :first-child { grid-column: 1 / -1; }
}

/* Phone: hide demo button text, keep just Request access pill */
@media (max-width: 560px) {
  nav.fin-nav { padding: 0 16px; height: 56px; }
  nav.fin-nav.is-scrolled { height: 50px; }
  .fin-logo .logo-text { font-size: 17px; }
  .fin-logo .logo-star { font-size: 19px; }
  .fin-nav-actions { gap: 6px; }
  .fin-nav-actions .fin-nav-demo { display: none; }
  .fin-nav-actions .fin-nav-cta {
    padding: 6px 11px;
    font-size: 10.5px;
    letter-spacing: 0.04em;
  }
}

/* ------- Trust strip (logos / markets) ------- */
.fin-trust {
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  padding: var(--s-6) 0;
}
.fin-trust-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-7); flex-wrap: wrap;
}
.fin-trust-label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-light);
  white-space: nowrap;
}
.fin-trust-row {
  display: flex; align-items: center; gap: var(--s-7); flex-wrap: wrap;
}
.fin-trust-row span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light);
  opacity: 0.55;
  transition: opacity var(--t-1) ease;
}
.fin-trust-row span:hover { opacity: 1; }

/* ------- Scroll reveal helpers ------- */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity var(--t-3) ease, transform var(--t-3) var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* ------- Utility ------- */
.text-cream { color: var(--cream); }
.text-muted { color: var(--muted-light); }
.surface-light .text-muted { color: var(--muted-dark); }
.divider { height: 1px; background: var(--line-dark); border: 0; margin: var(--s-7) 0; }
.surface-light .divider { background: var(--line-light); }

.hidden-mobile { }
@media (max-width: 720px) {
  .hidden-mobile { display: none !important; }
  :root { --gutter: 20px; --s-9: 64px; --s-10: 96px; }
}

/* ── Phone (≤560px) — global tweaks ── */
@media (max-width: 560px) {
  :root {
    --gutter: 16px;
    --s-7: 28px;
    --s-8: 40px;
    --s-9: 52px;
    --s-10: 72px;
  }
  .container { padding-left: 16px; padding-right: 16px; }
  /* Hero headings: clamp already set per page, but ensure body text is readable */
  .lede { font-size: 15px !important; line-height: 1.55 !important; }
  /* CTA buttons stack on tiny screens */
  .btn-group-inline { flex-direction: column !important; align-items: stretch !important; }
  .btn-group-inline a, .btn-group-inline button { text-align: center; }
  /* Footer columns: 1 column on phone */
  .fin-footer-grid { grid-template-columns: 1fr !important; }
  /* Trust strip wraps */
  .fin-trust-inner { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
}
