/* ==========================================================================
   FinSage — fintech / AI landing-page design system with motion
   Companion to references/design.md. Pair with assets/finsage.js for
   scroll reveals, ticker duplication, and terminal typing.
   ========================================================================== */


:root {
  /* color tokens */
  --fs-canvas: #FFFFFF;
  --fs-canvas-soft: #FAFAF9;
  --fs-ink: #0B0B0C;
  --fs-panel: #111113;
  --fs-text-secondary: #5A5A60;
  --fs-text-muted: #9C9CA3;
  --fs-line: #ECECEE;
  --fs-pastel-pink: #F59BDA;
  --fs-pastel-blue: #507DE9;
  --fs-pastel-cyan: #3FE1F8;
  --fs-pastel-orange: #EFC185;
  --fs-market-green: #16A34A;
  --fs-market-red: #EF4444;
  --fs-aurora-blue: #B9C8FF;
  --fs-aurora-purple: #E3C9F2;
  --fs-aurora-pink: #F5C6E8;
  --fs-aurora-cyan: #C6ECF5;

  /* type */
  --fs-font-display: 'Inter Tight', 'Inter', sans-serif;
  --fs-font-body: 'Inter', -apple-system, sans-serif;
  --fs-font-mono: 'JetBrains Mono', monospace;

  /* motion tokens */
  --fs-ease: cubic-bezier(0.22, 1, 0.36, 1);   /* springy ease-out */
  --fs-dur-micro: 200ms;
  --fs-dur-ui: 400ms;
  --fs-dur-enter: 800ms;

  /* elevation */
  --fs-shadow: 0 1px 2px rgba(11, 11, 12, 0.05);
  --fs-shadow-lift: 0 12px 32px rgba(11, 11, 12, 0.10);
}

/* ---------- base ---------- */

body {
  margin: 0;
  background: var(--fs-canvas);
  color: var(--fs-ink);
  font-family: var(--fs-font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .fs-display {
  font-family: var(--fs-font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--fs-ink);
  margin: 0;
  line-height: 1.05;
}
h1 { font-size: clamp(44px, 6vw, 72px); }
h2 { font-size: clamp(32px, 4vw, 48px); }

.fs-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fs-ink);
}
.fs-kicker::before { content: "●"; font-size: 8px; }

.fs-muted { color: var(--fs-text-muted); }
.fs-body-sm { font-size: 14px; color: var(--fs-text-secondary); }

::selection { background: var(--fs-ink); color: #fff; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--fs-ink);
  outline-offset: 2px;
}

/* ---------- film grain overlay ---------- */

.fs-grain { position: relative; }
.fs-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

/* ---------- aurora wash ---------- */

.fs-aurora {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(45% 55% at 18% 8%, var(--fs-aurora-blue) 0%, transparent 70%),
    radial-gradient(50% 60% at 82% 12%, var(--fs-aurora-pink) 0%, transparent 70%),
    radial-gradient(40% 50% at 55% 30%, var(--fs-aurora-purple) 0%, transparent 70%),
    radial-gradient(35% 45% at 90% 45%, var(--fs-aurora-cyan) 0%, transparent 70%),
    var(--fs-canvas);
  background-size: 160% 160%;
  animation: fs-aurora-drift 24s ease-in-out infinite alternate;
}
@keyframes fs-aurora-drift {
  from { background-position: 0% 0%, 100% 0%, 50% 30%, 100% 60%, 0 0; }
  to   { background-position: 10% 8%, 90% 10%, 45% 40%, 92% 50%, 0 0; }
}

/* ---------- ticker marquee ---------- */

.fs-ticker {
  overflow: hidden;
  background: var(--fs-ink);
  color: #fff;
  font-family: var(--fs-font-mono);
  font-size: 12px;
  padding: 8px 0;
  white-space: nowrap;
}
.fs-ticker__track {
  display: inline-flex;
  gap: 64px;
  animation: fs-marquee 30s linear infinite;
  will-change: transform;
}
.fs-ticker:hover .fs-ticker__track { animation-play-state: paused; }
@keyframes fs-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.fs-ticker__item { display: inline-flex; gap: 8px; align-items: center; }
.fs-ticker__up { color: var(--fs-market-green); }
.fs-ticker__down { color: var(--fs-market-red); }

/* ---------- nav ---------- */

.fs-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 48px;
  position: relative;
  z-index: 2;
}
.fs-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fs-font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.fs-nav__links { display: flex; gap: 28px; margin-left: auto; }
.fs-nav__links a {
  color: var(--fs-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--fs-dur-micro) var(--fs-ease);
}
.fs-nav__links a:hover { opacity: 0.55; }

/* ---------- venn logo mark ---------- */

.fs-venn {
  display: inline-grid;
  grid-auto-flow: column;
  width: max-content;
}
.fs-venn span {
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  margin-left: -7px;
  background: transparent;
}
.fs-venn span:first-child { margin-left: 0; }
.fs-venn--spin { animation: fs-venn-rotate 60s linear infinite; }
@keyframes fs-venn-rotate { to { transform: rotate(360deg); } }

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

.fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1px solid var(--fs-ink);
  border-radius: 14px;
  background: var(--fs-ink);
  color: #fff;
  font: 500 14px var(--fs-font-body);
  cursor: pointer;
  transition: transform var(--fs-dur-micro) var(--fs-ease),
              box-shadow var(--fs-dur-micro) var(--fs-ease),
              background var(--fs-dur-micro) var(--fs-ease),
              color var(--fs-dur-micro) var(--fs-ease);
}
.fs-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(11, 11, 12, 0.22);
}
.fs-btn:active { transform: translateY(0); }

.fs-btn--pill {
  border-radius: 999px;
  padding: 12px 28px;
  background: #fff;
  color: var(--fs-ink);
  border-color: #fff;
}
.fs-btn--pill:hover {
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.fs-btn--ghost {
  background: transparent;
  color: var(--fs-ink);
  border-color: var(--fs-line);
}
.fs-btn--ghost:hover { border-color: var(--fs-ink); box-shadow: none; }

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

.fs-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 96px 24px 128px;
}
.fs-hero__sub {
  font-size: 15px;
  color: var(--fs-text-secondary);
  margin: 0;
}
.fs-hero__form {
  width: min(560px, 90vw);
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.fs-hero__input {
  height: 52px;
  padding: 0 20px;
  border: 1px solid var(--fs-line);
  border-radius: 14px;
  background: #fff;
  font: 400 15px var(--fs-font-body);
  color: var(--fs-ink);
  outline: none;
  transition: border-color var(--fs-dur-micro) var(--fs-ease);
}
.fs-hero__input::placeholder { color: var(--fs-text-muted); }
.fs-hero__input:focus { border-color: var(--fs-ink); }

/* entrance choreography: stagger children */
.fs-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  animation: fs-enter var(--fs-dur-enter) var(--fs-ease) forwards;
}
.fs-stagger > *:nth-child(1) { animation-delay: 0ms; }
.fs-stagger > *:nth-child(2) { animation-delay: 100ms; }
.fs-stagger > *:nth-child(3) { animation-delay: 200ms; }
.fs-stagger > *:nth-child(4) { animation-delay: 300ms; }
.fs-stagger > *:nth-child(5) { animation-delay: 400ms; }
@keyframes fs-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* scroll reveal (activated by finsage.js adding .is-revealed) */
[data-fs-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--fs-ease), transform 700ms var(--fs-ease);
}
[data-fs-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- section head ---------- */

.fs-section {
  padding: 96px 48px;
  border-top: 1px solid var(--fs-line);
}
.fs-section--soft { background: var(--fs-canvas-soft); }
.fs-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 56px;
}
.fs-section__head p {
  max-width: 380px;
  margin: 0;
  font-size: 14px;
  color: var(--fs-text-secondary);
}

/* ---------- tab pills ---------- */

.fs-pills { display: inline-flex; gap: 8px; }
.fs-pill {
  padding: 8px 16px;
  border: 1px solid var(--fs-line);
  border-radius: 999px;
  background: #fff;
  font: 500 13px var(--fs-font-body);
  color: var(--fs-text-secondary);
  cursor: pointer;
  transition: all var(--fs-dur-micro) var(--fs-ease);
}
.fs-pill:hover { border-color: var(--fs-ink); color: var(--fs-ink); }
.fs-pill--active {
  background: var(--fs-ink);
  border-color: var(--fs-ink);
  color: #fff;
}

/* ---------- signal steps ---------- */

.fs-steps { position: relative; display: grid; gap: 24px; padding-left: 24px; }
.fs-steps::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--fs-ink);
}
.fs-step { position: relative; }
.fs-step::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--fs-ink);
}
.fs-step__card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--fs-line);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--fs-shadow);
}
.fs-step__title { font-weight: 600; font-size: 15px; }
.fs-step__desc { font-size: 13px; color: var(--fs-text-secondary); margin-top: 4px; }
.fs-step__status { font: 500 11px var(--fs-font-mono); }
.fs-step__status--done { color: var(--fs-market-green); }
.fs-step__status--run { color: var(--fs-ink); }
.fs-step__status--wait { color: var(--fs-text-muted); }

/* ---------- code terminal ---------- */

.fs-terminal {
  background: var(--fs-panel);
  border-radius: 20px;
  overflow: hidden;
  color: #E6E6E9;
  font-family: var(--fs-font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.fs-terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
}
.fs-terminal__dots { display: inline-flex; gap: 6px; }
.fs-terminal__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.fs-terminal__dots i:nth-child(1) { background: #FF5F57; }
.fs-terminal__dots i:nth-child(2) { background: #FEBC2E; }
.fs-terminal__dots i:nth-child(3) { background: #28C840; }
.fs-terminal__body {
  padding: 20px 24px 28px;
  white-space: pre-wrap;
  min-height: 200px;
}
.fs-terminal .tok-kw { color: #7EE787; }
.fs-terminal .tok-str { color: #79C0FF; }
.fs-terminal .tok-cm { color: #8B949E; }
.fs-terminal .tok-info { color: #7EE787; }
.fs-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #E6E6E9;
  vertical-align: -2px;
  animation: fs-caret-blink 1s steps(1) infinite;
}
@keyframes fs-caret-blink { 50% { opacity: 0; } }

/* ---------- pastel card carousel ---------- */

.fs-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 48px 32px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}
.fs-carousel::-webkit-scrollbar { display: none; }
.fs-carousel:active { cursor: grabbing; }
.fs-card {
  flex: 0 0 min(340px, 78vw);
  scroll-snap-align: start;
  border-radius: 20px;
  padding: 28px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  color: var(--fs-ink);
  transition: transform 250ms var(--fs-ease), box-shadow 250ms var(--fs-ease);
}
.fs-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--fs-shadow-lift);
}
.fs-card--pink { background: var(--fs-pastel-pink); }
.fs-card--blue { background: var(--fs-pastel-blue); color: #fff; }
.fs-card--cyan { background: var(--fs-pastel-cyan); }
.fs-card--orange { background: var(--fs-pastel-orange); }
.fs-card__title { font-family: var(--fs-font-display); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.fs-card__desc { font-size: 13px; margin-top: 8px; opacity: 0.85; }
.fs-card__link {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.fs-card__link:hover { text-decoration: underline; }
.fs-card__art {
  align-self: flex-end;
  margin-top: auto;
  opacity: 0.9;
}

/* ---------- roles columns ---------- */

.fs-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.fs-role h3 { font-size: 17px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.fs-role p { font-size: 13.5px; color: var(--fs-text-secondary); margin: 10px 0 0; }

/* ---------- dark CTA panel ---------- */

.fs-cta {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--fs-ink);
  color: #fff;
  text-align: center;
  padding: 96px 32px;
  margin: 0 48px;
}
.fs-cta::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(35% 45% at 15% 20%, rgba(80, 125, 233, 0.45) 0%, transparent 70%),
    radial-gradient(35% 45% at 85% 85%, rgba(245, 155, 218, 0.30) 0%, transparent 70%);
  pointer-events: none;
}
.fs-cta h2 { color: #fff; position: relative; }
.fs-cta p {
  position: relative;
  max-width: 520px;
  margin: 16px auto 32px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

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

.fs-footer { padding: 96px 48px 0; border-top: 1px solid var(--fs-line); }
.fs-footer__cols {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 64px;
  font-size: 13px;
}
.fs-footer__cols h4 { font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.fs-footer__cols a { display: block; color: var(--fs-text-secondary); text-decoration: none; margin: 6px 0; }
.fs-footer__cols a:hover { color: var(--fs-ink); }
.fs-footer__word {
  font-family: var(--fs-font-display);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-size: clamp(80px, 20vw, 300px);
  line-height: 0.85;
  margin: 64px 0 -0.12em;
  color: var(--fs-ink);
  user-select: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .fs-aurora,
  .fs-ticker__track,
  .fs-venn--spin,
  .fs-caret { animation: none; }
  .fs-stagger > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  [data-fs-reveal] {
    transition: opacity 200ms linear;
    transform: none;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
