/* ==========================================================================
   FleakStack — Core Stylesheet
   Design tokens, resets, typography, layout primitives, navbar, footer
   ========================================================================== */

:root {
  /* Color */
  --fs-primary: #6D28D9;
  --fs-primary-dark: #4C1D95;
  --fs-primary-light: #8B5CF6;
  --fs-primary-soft: #EFEAFB;
  --fs-primary-soft-2: #E4DBF9;

  --fs-bg: #FAFAFC;
  --fs-surface: #FFFFFF;
  --fs-dark: #0F0A1A;
  --fs-dark-2: #1B1428;

  --fs-text: #17121F;
  --fs-muted: #6B6475;
  --fs-muted-2: #8B84A0;
  --fs-border: #E4DFEF;
  --fs-border-strong: #D3CBE6;

  --fs-success: #0F9D68;
  --fs-success-soft: #E4F7EE;
  --fs-warning: #C77A0A;
  --fs-warning-soft: #FBF0DD;
  --fs-error: #D6423C;
  --fs-error-soft: #FBE9E8;

  --fs-code-bg: #140F20;
  --fs-code-text: #E9E4F5;
  --fs-code-muted: #8B84A0;
  --fs-code-border: #2B2340;

  /* Type */
  --fs-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* Radius */
  --fs-radius-sm: 6px;
  --fs-radius-md: 10px;
  --fs-radius-lg: 16px;

  /* Shadow */
  --fs-shadow-sm: 0 1px 2px rgba(15, 10, 26, 0.06);
  --fs-shadow-md: 0 6px 20px rgba(15, 10, 26, 0.08);

  /* Layout */
  --fs-container: 1200px;
  --fs-nav-height: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

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

body {
  margin: 0;
  font-family: var(--fs-font-sans);
  background: var(--fs-bg);
  color: var(--fs-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------- Focus ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--fs-primary);
  outline-offset: 2px;
  border-radius: var(--fs-radius-sm);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  color: var(--fs-text);
}

.fs-h1 { font-size: clamp(2.5rem, 4.6vw, 4rem); }
.fs-h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.fs-h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); }

p { margin: 0; }

.fs-lede {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--fs-muted);
  max-width: 46ch;
}

.fs-muted { color: var(--fs-muted); }
.fs-mono { font-family: var(--fs-font-mono); }

.fs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fs-primary);
  margin-bottom: 14px;
}

.fs-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fs-primary);
}

/* ---------- Layout ---------- */
.fs-container {
  width: 100%;
  max-width: var(--fs-container);
  margin: 0 auto;
  padding: 0 28px;
}

.fs-section {
  padding: 96px 0;
}

.fs-section--tight { padding: 64px 0; }
.fs-section--dark { background: var(--fs-dark); color: #EFEAFB; }
.fs-section--soft { background: var(--fs-surface); border-top: 1px solid var(--fs-border); border-bottom: 1px solid var(--fs-border); }

.fs-section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.fs-section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.fs-grid {
  display: grid;
  gap: 24px;
}

.fs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.fs-grid--3 { grid-template-columns: repeat(3, 1fr); }
.fs-grid--4 { grid-template-columns: repeat(4, 1fr); }

.fs-flex { display: flex; }
.fs-flex--between { justify-content: space-between; align-items: center; }
.fs-flex--center { justify-content: center; align-items: center; }
.fs-flex--gap { gap: 14px; }

/* ---------- Buttons ---------- */
.fs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--fs-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.fs-button:active { transform: translateY(1px); }

.fs-button--primary {
  background: var(--fs-primary);
  color: #fff;
}
.fs-button--primary:hover { background: var(--fs-primary-dark); }

.fs-button--ghost {
  background: transparent;
  color: var(--fs-text);
  border-color: var(--fs-border-strong);
}
.fs-button--ghost:hover { border-color: var(--fs-primary); color: var(--fs-primary); }

.fs-button--light {
  background: #fff;
  color: var(--fs-primary);
}
.fs-button--light:hover { background: var(--fs-primary-soft); }

.fs-button--dark {
  background: var(--fs-dark);
  color: #fff;
}
.fs-button--dark:hover { background: #000; }

.fs-button--full { width: 100%; }
.fs-button--sm { padding: 9px 16px; font-size: 0.85rem; }

.fs-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--fs-primary);
  font-size: 0.92rem;
}
.fs-link-arrow svg { width: 15px; height: 15px; transition: transform 0.15s ease; }
.fs-link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Navbar ---------- */
.fs-navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(250, 250, 252, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--fs-border);
  height: var(--fs-nav-height);
}

.fs-navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.fs-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--fs-text);
  flex-shrink: 0;
}

.fs-logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fs-primary);
  position: relative;
  flex-shrink: 0;
}
.fs-logo__mark::before,
.fs-logo__mark::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 1px;
}
.fs-logo__mark::before { width: 12px; height: 2px; top: 10px; left: 8px; }
.fs-logo__mark::after { width: 8px; height: 2px; top: 16px; left: 8px; }

.fs-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fs-nav-links a {
  padding: 9px 14px;
  border-radius: var(--fs-radius-sm);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--fs-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.fs-nav-links a:hover { background: var(--fs-primary-soft); color: var(--fs-primary); }
.fs-nav-links a[aria-current="page"] { color: var(--fs-primary); }

.fs-navbar__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.fs-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--fs-border-strong);
  border-radius: var(--fs-radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.fs-nav-toggle svg { width: 18px; height: 18px; }

.fs-mobile-drawer {
  position: fixed;
  inset: var(--fs-nav-height) 0 0 0;
  background: var(--fs-bg);
  z-index: 490;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 24px 28px 40px;
}
.fs-mobile-drawer.is-open { transform: translateX(0); }
.fs-mobile-drawer a {
  display: block;
  padding: 16px 4px;
  font-size: 1.05rem;
  font-weight: 550;
  border-bottom: 1px solid var(--fs-border);
}
.fs-mobile-drawer__actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.fs-no-scroll { overflow: hidden; }

/* ---------- Footer ---------- */
.fs-footer {
  background: var(--fs-dark);
  color: #C9C2DC;
  padding: 72px 0 32px;
}

.fs-footer__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.fs-footer__brand .fs-logo { color: #fff; }
.fs-footer__brand p { margin-top: 14px; color: #9088A6; max-width: 32ch; font-size: 0.92rem; }

.fs-footer__col h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.fs-footer__col ul li { margin-bottom: 11px; }
.fs-footer__col a { font-size: 0.9rem; color: #A79FC0; transition: color 0.15s ease; }
.fs-footer__col a:hover { color: #fff; }

.fs-footer__bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #7A7192;
}

.fs-footer__bottom a { color: #A79FC0; }
.fs-footer__bottom a:hover { color: #fff; }

/* ---------- Utility ---------- */
.fs-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.fs-skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--fs-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--fs-radius-sm);
  z-index: 1000;
  transition: top 0.15s ease;
}
.fs-skip-link:focus { top: 12px; }

.fs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.fs-badge--success { background: var(--fs-success-soft); color: var(--fs-success); }
.fs-badge--warning { background: var(--fs-warning-soft); color: var(--fs-warning); }
.fs-badge--error { background: var(--fs-error-soft); color: var(--fs-error); }
.fs-badge--neutral { background: var(--fs-primary-soft); color: var(--fs-primary); }

.fs-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
