/* Top nav with pane-style dropdowns and CDE-indent hover */

/* The nav sticks 12px from the top and is 60px tall, so when stuck its
   bottom edge is at 72px. Anything else that sticks must clear that, or it
   docks UNDERNEATH the nav and the top of it is invisible. Published as a
   token so the number is stated once, next to the values that produce it.

   It is the same on every environment: the "LOCAL — not production" /
   staging banner is position:static and scrolls away, so it never shifts
   where the nav docks. Measured 2026-10-29, after the catalog's sticky
   search box was found hiding behind the nav. */
:root { --lp-nav-bottom: 72px; }

.lp-nav {
  position: sticky; top: 12px; z-index: 50;
  margin: 12px auto 0;
  max-width: 1240px;
  padding: 0 20px;
}

.lp-nav-inner {
  display: flex; align-items: center; gap: 12px;
  height: 60px;
  background: color-mix(in oklab, var(--lp-paper) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-pill);
  padding: 8px 10px 8px 18px;
  box-shadow: var(--lp-shadow-2);
}

/* Alt nav treatment — square pane */
/* Alt nav — floating rail */
.lp-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: var(--lp-ink);
}
.lp-logo-mark {
  width: 26px; height: 26px; display: grid; place-items: center;
  position: relative;
}
.lp-logo-mark svg { display: block; width: 22px; height: 22px; }

.lp-nav-links {
  display: flex; align-items: center; gap: 2px;
  margin-left: 8px;
  padding: 4px;
}

.lp-nav-item {
  position: relative;
}

.lp-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--lp-ink-2);
  background: transparent;
  border: 1px solid transparent;
  transition: background .18s var(--lp-ease), color .18s var(--lp-ease), box-shadow .18s var(--lp-ease), transform .18s var(--lp-ease);
}
.lp-nav-link:hover {
  color: var(--lp-ink);
  /* CDE-inset hover */
  background: linear-gradient(180deg, #efe9dd, #f4efe4);
  box-shadow: var(--lp-shadow-inset-cde);
  border-color: var(--lp-line);
}
.lp-nav-link[aria-expanded="true"] {
  color: var(--lp-ink);
  background: linear-gradient(180deg, #efe9dd, #f4efe4);
  box-shadow: var(--lp-shadow-inset-cde);
  border-color: var(--lp-line);
}
.lp-nav-link.is-active {
  color: var(--lp-ink);
  background: var(--lp-amber-wash);
  border-color: var(--lp-amber-soft);
}
.lp-nav-link .chev {
  width: 10px; height: 10px; opacity: .7;
  transition: transform .18s var(--lp-ease);
}
.lp-nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lp-nav-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.lp-nav-actions .btn { height: 36px; font-size: 13px; }

/* Mobile menu toggle — hidden on desktop, revealed by page CSS at narrow widths */
.lp-nav-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--lp-line);
  background: var(--lp-paper);
  align-items: center; justify-content: center;
  color: var(--lp-ink); cursor: pointer;
  margin-left: 4px;
}
.lp-nav-menu-btn:hover { box-shadow: var(--lp-shadow-2); }

/* Mobile drawer — a pane that floats close-but-not-touching below the nav */
.lp-mobile-drawer {
  position: fixed; left: 20px; right: 20px; top: 82px;
  background: var(--lp-paper);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-lg);
  box-shadow: var(--lp-shadow-3);
  padding: 10px;
  display: none;
  z-index: 55;
}
.lp-mobile-drawer.is-open { display: block; }
.lp-mobile-drawer a {
  display: block; padding: 12px 14px; font-size: 15px; font-weight: 500;
  color: var(--lp-ink); border-radius: 10px;
  border: 1px solid transparent;
}
.lp-mobile-drawer a:hover {
  background: linear-gradient(180deg, #efe9dd, #f4efe4);
  box-shadow: var(--lp-shadow-inset-cde);
  border-color: var(--lp-line);
}

/* Mobile nav breakpoint — lives here so every page gets it, not just the homepage */
@media (max-width: 1020px) {
  .lp-nav-links { display: none !important; }
  .lp-nav-menu-btn { display: inline-flex !important; }
}
/* On a narrow phone the marketing nav's contents (logo + CTA + menu button)
   cannot shrink below their intrinsic width, so the button overflowed the nav's
   own padding and pushed the PAGE 2px wide — enough for a horizontal scrollbar.
   Buying back 22px of chrome padding is less destructive than letting the CTA
   shrink or wrap. Found 2026-08-20 by the layout gate. */
@media (max-width: 420px) {
  .lp-nav { padding: 0 12px; }
  .lp-nav-inner { padding: 8px 8px 8px 14px; gap: 8px; }
}
/* 2026-10-07: that 22px was no longer enough — EVERY marketing page overflowed
   by 30px at 390px. The bar wanted logo 117 + "Sign in" 75 + "Get early access"
   138 + menu button 36, plus gaps: ~393px of content for ~344px of room. The
   layout gate had been calling this a PASS for months because it ran under an
   interpreter with no Playwright and its SKIP returned 0 (fixed in
   build-tools/run-checks.sh #5), so nobody saw it.

   2026-11-06: the two auth buttons became ONE ("Register or sign in", 143px),
   so the 460px rule that dropped the ghost "Sign in" first had nothing left to
   target and is gone — there is no btn-ghost in a marketing .lp-nav-actions
   any more, checked across every page and both nav generators.

   The 370px rule stays, and it was re-measured rather than assumed: without
   the button the bar is 344px at 370px wide, so adding 143px + an 8px gap
   would overflow by ~130px. Measured at 320/360/370/390/430/460/520 after the
   change — no overflow at any of them. The link is still in the hamburger
   drawer, so dropping it from the BAR costs no reachability. */
@media (max-width: 370px) {
  .lp-nav:not(.lp-nav-app) .lp-nav-actions .btn { display: none; }
}

/* The floating pane dropdown — close to but not touching the trigger */
/* Footer */
.lp-footer {
  margin-top: 120px;
  padding: 60px 0 40px;
  border-top: 1px solid var(--lp-line);
  background: linear-gradient(180deg, transparent, rgba(255, 200, 90, 0.05));
}
/* On auth/workflow pages (login, register, password-reset, verify-
   email, confirm-password) the .auth-wrap card already supplies an
   80px bottom margin to space itself from the footer; the global
   120px footer margin stacks on top of that and the resulting gap
   ends up asymmetric. Body class `lp-auth-page` (set on each access
   page) zeros the footer's top margin so the auth-card's own margin
   is the only gap. Other pages (landing, demos, docs) keep the
   120px because their bottom-most sections don't carry equivalent
   bottom margins. */
body.lp-auth-page .lp-footer { margin-top: 0; }

/* Authenticated app-mode pill nav — visually distinct from the
   marketing nav so it's instantly obvious the user is inside a
   logged-in area. Same .lp-nav structure (sticky pill, identical
   spacing + layout), just a tinted background and stronger nav-link
   contrast. Triggered by the .lp-nav-app class which chrome-builder.js
   renders when LPChrome.mount('app:*') is called. */
.lp-nav.lp-nav-app .lp-nav-inner {
  /* Amber at ~66% mixed with paper, not raw rgba — keeps the result
     opaque so the blur backdrop and other nav-inner styling don't
     get washed out by whatever shows through. */
  background: color-mix(in oklab, var(--lp-amber) 66%, var(--lp-paper));
}
.lp-nav.lp-nav-app .lp-nav-link {
  /* Default nav links are var(--lp-ink-2) (mid grey). Black on the
     amber-tinted background reads stronger and reinforces the "you
     are in the console" signal. */
  color: var(--lp-ink);
}
.lp-nav.lp-nav-app .lp-nav-link:hover {
  /* The marketing-nav hover paints a cream linear-gradient that was
     designed for the white pill background — on the 66%-amber app
     pill it reads as a washed-out grey artefact. Amber-soft sits
     between the pill background (66% amber mix) and amber-wash
     (active-state), so hover/active form a clear lighter -> darker
     stack as the cursor moves into and lands on a link. */
  background: var(--lp-amber-soft);
}

/* Marketing pages get a soft radial warm glow behind .lp-page-head
   (via --lp-glow-warm). On the authenticated app surface we want
   the opposite vibe — flat, console-like. Setting the variable to
   none on the body resolves the existing
   `background: var(--lp-glow-warm)` inside .lp-page-head::before
   to no value, so the gradient simply doesn't paint. Marketing,
   docs, and access pages keep the glow. */
body.lp-app-page { --lp-glow-warm: none; }
.lp-footer-grid {
  display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 40px;
}
.lp-footer h5 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--lp-ink-3); font-family: var(--lp-font-mono); font-weight: 500;
  margin-bottom: 14px;
}
.lp-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--lp-ink-2); }
.lp-footer a:hover { color: var(--lp-ember); }
.lp-footer-bottom {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--lp-line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--lp-ink-3);
}
/* The footer grid had NO responsive collapse: four columns held their width at
   every viewport, so on a phone the last column ("Company") sat outside the
   viewport and the whole PAGE scrolled sideways — on every page of the site,
   not just one. Found 2026-08-20 by the layout gate
   (build-tools/site-checks/check_page_layout.py), which is exactly the class of
   bug it was built for: nothing that reads source can see it.
   Desktop is deliberately unchanged. */
@media (max-width: 860px) {
  .lp-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .lp-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .lp-footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Tweaks panel */

/* ============================================================
   Amber header band — pages opt in via body.has-amber-header
   ============================================================
   Paints a gradient strip behind the floating nav so the area
   above the hero doesn't look like a stark white slab. The
   gradient lands on --lp-amber-wash at the bottom (y=72px) so
   it joins the top of any subsequent amber-wash hero gradient
   continuously — no visible seam.

   Layout math: nav has margin-top: 12px and height: 60px, so it
   occupies y=12px to y=72px. Sizing the gradient to exactly 72px
   puts amber-wash at the hero boundary; the hero's opaque
   background paints over everything below. Top stop is a 50/50
   mix of --lp-amber-wash and --lp-amber-soft for the "slightly
   darker amber" feel. */
body.has-amber-header {
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--lp-amber-wash) 50%, var(--lp-amber-soft)) 0%,
      var(--lp-amber-wash) 100%) no-repeat;
  background-size: 100% 72px;
  background-color: var(--lp-canvas);
}

/* ------------------------------------------------------------------
   .lp-inner-wash — the SECOND half of the header treatment.
   ------------------------------------------------------------------
   `body.has-amber-header` only paints to y=72px, ending ON
   --lp-amber-wash so it can hand over to a page's own header
   gradient. The landing pages do that with `.lp-page-head`
   (inner.css) and the catalog index with `.lp-catalog-hero`
   (catalog.css) — both full-bleed sections that start at amber-wash
   and fade to canvas.

   The /build/ guides and the 210 catalog pane/service pages had the
   band but NO second half, so they rendered flat grey: both halves
   were missing together, which is why it read as "no gradient at
   all" rather than as a seam. Adding only the body class would have
   been worse than leaving it — the band would stop dead at
   amber-wash (#fff7dc) against canvas (#fbfaf7), a hard line at a
   fixed pixel.

   This is the same recipe as those two heroes, but bounded by
   HEIGHT rather than by the element, because `.lp-guide` and
   `.lp-catalog-pane` wrap the whole page body — a gradient over
   their full height would tint the entire page. 260px covers the
   breadcrumb + h1 + lede on both layouts and lands on canvas, so
   content below sits on flat canvas with no edge to see.

   ONE rule in chrome.css (which every page loads) rather than a
   copy per stylesheet, so the next change to the header treatment
   is one edit — the reason this was asked for.

   Pages deliberately NOT using it: the homepage and /docs/ have
   their own header designs by intent. */
.lp-inner-wash {
  background:
    linear-gradient(180deg,
      var(--lp-amber-wash) 0%,
      var(--lp-canvas) 100%) no-repeat;
  background-size: 100% 260px;
  background-color: var(--lp-canvas);
}
