/* ===========================================================================
   FKMP — dark editorial / technical design system
   Display+body: Instrument Sans · Data/mono: JetBrains Mono
   =========================================================================== */

:root {
  /* -- surfaces -- */
  --bg:        #0a0c10;
  --surface:   #12151c;
  --surface-2: #171b24;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.14);

  /* -- text -- */
  --ink:    #f2f4f8;
  --ink-2:  #aab2c0;
  --muted:  #6b7480;

  /* -- accent (single) -- */
  --accent:      #4d6bff;
  --accent-ink:  #7d92ff;
  --accent-dim:  rgba(77,107,255,.14);

  /* -- type -- */
  --font:  'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* -- layout -- */
  --maxw:   1100px;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }
.muted { color: var(--muted); }

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

/* ---- Eyebrow -------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 18px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent);
  display: inline-block;
}

/* ---- Wordmark -------------------------------------------------------------- */
.wordmark {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.3rem;
  color: var(--ink);
}
.wordmark span { color: var(--accent); }
.wordmark.sm { font-size: 1.1rem; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: baseline; gap: .5em; justify-content: center;
  font-family: var(--font); font-size: .95rem; font-weight: 600;
  padding: .85rem 1.4rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .55rem 1.05rem; font-size: .85rem; }
.btn-primary { background: var(--accent); color: #06070a; box-shadow: 0 0 0 0 rgba(77,107,255,0); }
.btn-primary:hover { background: var(--accent-ink); box-shadow: 0 8px 24px -8px rgba(77,107,255,.55); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-2); background: rgba(255,255,255,.04); }
.btn__meta { font-family: var(--mono); font-size: .78em; font-weight: 500; opacity: .75; }

/* ---- Nav ----------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-links { display: flex; align-items: center; gap: 48px; }
.nav-links-inner { display: flex; align-items: center; gap: 44px; }
.nav-links a:not(.btn) {
  font-size: .92rem; color: var(--ink-2); transition: color .15s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px;
  width: 40px; height: 40px; color: var(--ink); cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links-inner { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links { position: fixed; inset: 72px 0 auto 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
  .nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links-inner.is-open { display: flex; flex-direction: column; gap: 4px; }
  .nav-links a:not(.btn) { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-cta { display: none; }
  .nav-links.is-open .nav-cta { display: flex; padding-top: 14px; }
}

/* ---- Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(94vh, 920px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  background: var(--bg);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(0deg, rgba(6,7,10,.96) 4%, rgba(6,7,10,.72) 42%, rgba(6,7,10,.42) 68%, rgba(6,7,10,.55) 100%),
    linear-gradient(90deg, rgba(6,7,10,.5) 0%, rgba(6,7,10,.1) 45%, rgba(6,7,10,.5) 100%);
}
.hero-inner { padding-block: 120px 72px; width: 100%; }
.hero-copy { max-width: 780px; }
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hero h1 .dim { color: var(--ink-2); font-weight: 700; }
.hero .lead {
  margin-top: 26px;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
  max-width: 620px;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 38px; }
.hero-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 52px; }
.hero-tile {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .82rem; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: .55rem 1rem; background: rgba(255,255,255,.03);
}
.hero-tile::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

@media (max-width: 640px) {
  .hero { min-height: 100svh; align-items: flex-end; }
  .hero-inner { padding-block: 100px 48px; }
  .hero-actions .btn { width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
}

/* ---- Scroll reveal ---------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Blur-in reveal (signature motion) — used on section headlines' muted clause */
.reveal-blur { display: inline-block; filter: blur(10px); opacity: 0; transform: translateY(6px); transition: filter .75s cubic-bezier(.2,.7,.2,1), opacity .75s ease, transform .75s cubic-bezier(.2,.7,.2,1); }
.reveal-blur.is-visible { filter: blur(0); opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-blur { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ===========================================================================
   Preloader — pure CSS keyframes, so it runs from first paint regardless of
   script execution or webfont fetch timing (both can lag on slow networks).
   =========================================================================== */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden; padding-inline: 20px;
}
.preloader-phrase {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  font-family: var(--font); font-weight: 700; text-transform: uppercase; line-height: 1;
  font-size: clamp(.78rem, 4.2vw, 2.4rem); letter-spacing: -0.03em; color: var(--ink);
}
.preloader-phrase .pl-word {
  display: inline-block; filter: blur(14px); opacity: 0; transform: translateY(10px);
  animation: pl-in .5s ease forwards;
  animation-delay: calc(var(--i) * 140ms + 120ms);
}
.preloader-phrase .pl-init, .preloader-phrase .pl-rest, .preloader-phrase .pl-space {
  display: inline-block; overflow: hidden; white-space: pre;
}
.preloader-phrase .pl-drop {
  display: inline-block; overflow: hidden; white-space: pre;
  filter: blur(14px); opacity: 0; transform: translateY(10px);
}
.preloader-phrase .pl-dot {
  display: inline-block; overflow: hidden; color: var(--accent);
  opacity: 0; transform: translateY(6px);
}

@keyframes pl-in {
  to { filter: blur(0); opacity: 1; transform: translateY(0); }
}

/* Contraction: once the full phrase has settled (last word delay 680ms + 500ms
   duration = 1180ms) and held briefly, each word's trailing letters (and the
   whole word "and") collapse away — max-width starts larger than any rendered
   word so it behaves like auto, then animates to 0 — so flexbox reflows the
   four initials together into "FKMP" while the phrase itself grows up to the
   final wordmark size. */
@media (prefers-reduced-motion: no-preference) {
  .preloader-phrase .pl-rest, .preloader-phrase .pl-space {
    max-width: 260px;
    animation: pl-collapse .9s cubic-bezier(.6,0,.2,1) 1550ms forwards;
  }
  .preloader-phrase .pl-drop {
    max-width: 260px;
    animation:
      pl-in .5s ease calc(var(--i) * 140ms + 120ms) forwards,
      pl-collapse .9s cubic-bezier(.6,0,.2,1) 1550ms forwards;
  }
  .preloader-phrase {
    animation: pl-grow .9s cubic-bezier(.6,0,.2,1) 1550ms forwards;
  }
  .preloader-phrase .pl-dot {
    animation: pl-dot-in .35s ease 1000ms forwards;
  }
}
@keyframes pl-collapse {
  to { max-width: 0; opacity: 0; margin: 0; }
}
@keyframes pl-grow {
  to { font-size: clamp(2.4rem, 7vw, 5rem); }
}
@keyframes pl-dot-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Whole panel lifts away once the acronym has settled (contract ends at
   1550ms + 900ms = 2450ms, +400ms hold = 2850ms), then is removed from hit
   testing and the a11y tree at the end of the animation. */
@media (prefers-reduced-motion: no-preference) {
  .preloader {
    animation: pl-leave .6s cubic-bezier(.6,0,.2,1) 2850ms forwards;
  }
  html {
    animation: pl-scroll-lock 3450ms forwards;
  }
}
@keyframes pl-leave {
  to { opacity: 0; transform: translateY(-4%); pointer-events: none; visibility: hidden; }
}
@keyframes pl-scroll-lock {
  99% { overflow: hidden; }
  100% { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader { display: none; }
}

/* ===========================================================================
   Section shell
   =========================================================================== */
.section { padding-block: 110px; border-bottom: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section:last-of-type { border-bottom: none; }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-title { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
.section-title .dim { color: var(--ink-2); }
.section-lead { margin-top: 18px; color: var(--ink-2); font-size: 1.05rem; max-width: 560px; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .section { padding-block: 72px; }
  .section-head { margin-bottom: 40px; }
}

/* ===========================================================================
   Capabilities
   =========================================================================== */
.cap-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cap-card {
  background: var(--surface); padding: 32px 28px; transition: background .2s ease, transform .2s ease;
}
.cap-card:hover { background: var(--surface-2); transform: translateY(-2px); }

/* The 5th (newest) capability gets a deliberate full-width treatment instead
   of leaving an uneven gap in a 4-column grid. */
.cap-card--wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 28px; align-items: baseline;
}
.cap-card--wide p { max-width: 480px; }

@media (max-width: 860px) {
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .cap-card--wide { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 520px) {
  .cap-grid { grid-template-columns: 1fr; }
}
.cap-tag {
  display: inline-block; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--accent-ink); background: var(--accent-dim); border-radius: 999px;
  padding: .3rem .65rem; margin-bottom: 20px;
}
.cap-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.cap-card p { color: var(--ink-2); font-size: .94rem; }

/* ===========================================================================
   Demos
   =========================================================================== */
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.demo-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: transform .2s ease, border-color .2s ease; }
.demo-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.demo-video-wrap { position: relative; aspect-ratio: 16/10; background: #06070a; }
.demo-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.demo-text { padding: 24px 26px 28px; }
.demo-tag { font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 10px; display: block; }
.demo-text h3 { font-size: 1.08rem; margin-bottom: 8px; }
.demo-text p { color: var(--ink-2); font-size: .92rem; }

@media (max-width: 780px) {
  .demo-grid { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Workflow
   =========================================================================== */
.workflow-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; position: relative; }
.workflow-row::before {
  content: ""; position: absolute; top: 22px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--line-2) 100%); opacity: .5;
}
.wf-step { position: relative; padding-top: 4px; }
.wf-idx {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: .85rem; color: var(--accent-ink); margin-bottom: 22px; position: relative; z-index: 1;
}
.wf-step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.wf-step p { color: var(--ink-2); font-size: .95rem; max-width: 320px; }

@media (max-width: 780px) {
  .workflow-row { grid-template-columns: 1fr; gap: 40px; }
  .workflow-row::before { display: none; }
}

/* ===========================================================================
   Native to Fusion
   =========================================================================== */
.native-panel {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 48px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
}
.native-panel p.lead { color: var(--ink-2); font-size: 1.08rem; max-width: 640px; margin-top: 16px; }
.native-nots { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.native-not {
  font-family: var(--mono); font-size: .82rem; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 999px; padding: .5rem 1rem;
}
.native-not::before { content: "not needed — "; color: var(--muted); opacity: .7; }

@media (max-width: 640px) {
  .native-panel { padding: 32px 24px; }
}

/* ===========================================================================
   Install
   =========================================================================== */
.install-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 64px; }
.install-version { font-family: var(--mono); font-size: .82rem; color: var(--muted); }

.quickstart { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 72px; }
.qs-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; background: var(--surface); }
.qs-idx { font-family: var(--mono); color: var(--accent-ink); font-size: .85rem; margin-bottom: 12px; display: block; }
.qs-step h4 { font-size: 1.02rem; margin-bottom: 8px; }
.qs-step p { color: var(--ink-2); font-size: .9rem; }

.terminal {
  border: 1px solid var(--line-2); border-radius: var(--radius); background: #06070a; overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.terminal-bar em { font-style: normal; font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-left: 8px; }
.terminal-body { padding: 26px 28px 30px; font-family: var(--mono); font-size: .88rem; line-height: 1.9; color: var(--ink-2); }
.terminal-body .tl { display: flex; gap: 16px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.terminal-body .tl:last-child { border-bottom: none; }
.terminal-body .tn { color: var(--accent-ink); flex: none; width: 1.6em; }
.terminal-body strong { color: var(--ink); font-weight: 600; }
.terminal-body code { color: var(--accent-ink); background: rgba(77,107,255,.1); padding: .1em .4em; border-radius: 4px; font-size: .92em; }

.marquee { margin-top: 56px; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.marquee-track { display: flex; gap: 48px; white-space: nowrap; width: max-content; animation: marquee 26s linear infinite; }
.marquee span { font-family: var(--mono); font-size: .84rem; letter-spacing: .06em; color: var(--muted); }
.marquee span b { color: var(--ink-2); font-weight: 500; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

@media (max-width: 780px) {
  .quickstart { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Bands / final CTA
   =========================================================================== */
.band {
  padding-block: 88px; text-align: center; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 28px; }

.final-cta {
  padding-block: 130px; text-align: center; position: relative; overflow: hidden;
}
.final-cta h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 780px; margin: 0 auto 36px; }
.final-cta-actions { display: flex; justify-content: center; }

/* ===========================================================================
   Updates & feedback
   =========================================================================== */
.feedback-form { display: grid; gap: 16px; max-width: 520px; margin-top: 32px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.field { display: grid; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.field input, .field textarea {
  font-family: var(--font); font-size: .95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; padding: .75rem .9rem; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.feedback-status { font-family: var(--mono); font-size: .82rem; color: var(--accent-ink); min-height: 1.2em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ===========================================================================
   Footer
   =========================================================================== */
.footer { padding-block: 64px 48px; }
.footer-inner { display: grid; gap: 14px; max-width: 620px; }
.footer p { color: var(--ink-2); font-size: .92rem; }
.footer .credit a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.footer .credit a:hover { text-decoration-color: var(--accent); }
.footer .fine { color: var(--muted); font-size: .82rem; }
