/* ==========================================================================
   Llab Technologies — "Field Manual" design system
   Blueprint-grid, hard-edged, offset-shadow aesthetic.
   Inline styles on each page carry the pixel-level visual detail; this
   stylesheet owns the shared chrome, hover states, and responsive behavior
   that the static design references did not specify.
   ========================================================================== */

:root {
  --ink:        #101B33;
  --cobalt:     #1E40AF;
  --purple:     #6D28D9;
  --page:       #F4F6FA;
  --body:       #3D4A66;
  --muted:      #7B87A0;
  --hairline:   #C6CEDC;
  --bracket:    #94A0B8;
  --term-bg:    #0A0F1C;
  --term-text:  #C9D4E8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--page);
  font-family: 'Sora', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* Respect reduced-motion: freeze cursors and disable transitions */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   Page shell — blueprint grid background
   -------------------------------------------------------------------------- */
.fm-page {
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(30,64,175,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,64,175,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}
.fm-page--purple {
  background-image:
    linear-gradient(rgba(109,40,217,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109,40,217,.06) 1px, transparent 1px);
}

.fm-wrap { max-width: 1120px; margin: 0 auto; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.fm-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  border-bottom: 1.5px solid var(--ink);
  background: rgba(244,246,250,.94);
  backdrop-filter: blur(8px);
}
.fm-logo {
  display: flex; align-items: baseline; gap: 2px;
  font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--ink);
}
.fm-logo .b { color: var(--bracket); }
.fm-logo .l { color: var(--cobalt); }

.fm-nav__links {
  display: flex; gap: 24px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500;
}
.fm-navlink {
  color: var(--body);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.fm-navlink:hover { color: var(--ink); }
.fm-navlink.is-active { color: var(--cobalt); border-bottom-color: var(--cobalt); }

.fm-nav__cta {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600;
  color: var(--page); background: var(--cobalt);
  padding: 10px 16px;
  border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.fm-nav__cta:hover { color: var(--page); transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.fm-nav__cta--purple { background: var(--purple); }

/* Hamburger — hidden on desktop */
.fm-hamburger {
  display: none;
  flex-direction: column; gap: 4px; cursor: pointer;
  background: none; border: 1.5px solid var(--ink); padding: 8px;
}
.fm-hamburger span { width: 18px; height: 2px; background: var(--ink); transition: .2s; }
.fm-hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fm-hamburger.is-open span:nth-child(2) { opacity: 0; }
.fm-hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Buttons (offset-shadow, mono, uppercase) — hover lift
   -------------------------------------------------------------------------- */
.fm-btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600;
  padding: 15px 24px;
  border: 1.5px solid var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.fm-btn--primary { background: var(--cobalt); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.fm-btn--primary:hover { color: #fff; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.fm-btn--purple { background: var(--purple); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.fm-btn--purple:hover { color: #fff; transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.fm-btn--outline { background: #fff; color: var(--ink); }
.fm-btn--outline:hover { color: var(--ink); transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); }
.fm-btn--light { background: var(--page); color: var(--ink); border: none; box-shadow: 4px 4px 0 var(--cobalt); }
.fm-btn--light:hover { color: var(--ink); transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--cobalt); }

/* Text links with arrow — subtle nudge on hover */
.fm-arrow { display: inline-block; transition: transform .12s ease; }
.fm-arrow:hover { transform: translateX(3px); }

/* Feature cards / table rows — hover tint */
.fm-card { transition: transform .12s ease, box-shadow .12s ease; }
.fm-row { transition: background .12s ease; }
.fm-row:hover { background: rgba(30,64,175,.03); }

/* Big display headline — class so it can shrink on small screens */
.fm-h1 { font-weight: 800; letter-spacing: -.035em; }

/* --------------------------------------------------------------------------
   Long-form article prose (blog posts)
   -------------------------------------------------------------------------- */
.fm-prose { color: var(--body); font-size: 17px; line-height: 1.75; }
.fm-prose > * + * { margin-top: 20px; }
.fm-prose h2 {
  color: var(--ink); font-size: 26px; font-weight: 800; letter-spacing: -.02em;
  line-height: 1.2; margin-top: 44px;
}
.fm-prose h2::before {
  content: attr(data-fig);
  display: block; margin-bottom: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500;
  letter-spacing: .04em; color: var(--muted);
}
.fm-prose h3 { color: var(--ink); font-size: 19px; font-weight: 700; margin-top: 32px; }
.fm-prose p { margin-top: 18px; }
.fm-prose a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px; }
.fm-prose a:hover { color: var(--ink); }
.fm-prose ul, .fm-prose ol { margin-top: 18px; padding-left: 22px; }
.fm-prose li { margin-top: 8px; }
.fm-prose li::marker { color: var(--cobalt); }
.fm-prose blockquote {
  margin-top: 24px; padding: 18px 24px;
  border-left: 3px solid var(--cobalt); background: #fff;
  font-size: 19px; font-weight: 600; color: var(--ink);
}
.fm-prose strong { color: var(--ink); font-weight: 700; }
.fm-prose code {
  font-family: 'IBM Plex Mono', monospace; font-size: .9em;
  background: #fff; border: 1px solid var(--hairline); padding: 1px 6px;
}
.fm-prose hr { border: none; border-top: 1.5px solid var(--ink); margin: 40px 0; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Any grid tagged .fm-collapse becomes a single column on tablet/mobile.
   The !important only fires inside the breakpoint, so desktop pixel fidelity
   (with per-page inline grid-template-columns) is untouched. */
@media (max-width: 900px) {
  .fm-nav { padding: 14px 20px; flex-wrap: wrap; }
  .fm-hamburger { display: flex; order: 3; }
  .fm-nav__links {
    order: 4; flex-basis: 100%;
    flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
  }
  .fm-nav__links.is-open { max-height: 480px; margin-top: 12px; }
  .fm-nav__links .fm-navlink {
    padding: 12px 2px; border-bottom: 1px solid var(--hairline);
  }
  .fm-navlink.is-active { border-bottom: 1px solid var(--cobalt); }

  .fm-collapse { grid-template-columns: 1fr !important; gap: 32px !important; }
  .fm-collapse-2 { grid-template-columns: 1fr 1fr !important; }

  .fm-h1 { font-size: 40px !important; line-height: 1.05 !important; }
  .fm-h2 { font-size: 28px !important; }

  /* Section padding relief */
  .fm-pad { padding-left: 20px !important; padding-right: 20px !important; }

  /* Horizontal scroll escape hatch for wide diagrams (SVG topology, tables) */
  .fm-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 560px) {
  .fm-collapse-2 { grid-template-columns: 1fr !important; }
  .fm-h1 { font-size: 32px !important; }
  .fm-nav { padding: 12px 16px; }
}
