/* =====================================================================
   The Fuel Lab — shared top menu bar
   Scoped under .fl-menu so it never collides with page CSS
   (Tailwind on the homepage, the fl- and arc- prefixes on static pages).
   Brand-locked tokens only. Relies on Excalifont being font-faced by
   the styles.css every page already loads.
   ===================================================================== */

:root {
  --flm-teal: #2A9D8F;
  --flm-teal-dark: #1F7268;
  --flm-teal-soft: #BFEAE5;
  --flm-cream: #FFFBF5;
  --flm-ink: #2C2C2A;
  --flm-ink-soft: #5A5A55;
}

/* Kill horizontal overflow site-wide: decorative absolutely-positioned doodles
   peek past the viewport edge on narrow screens. `clip` (not `hidden`) does NOT
   create a scroll container, so the sticky menu keeps working. (Fixed elements
   aren't clipped by this — the drawer is handled separately by the scrim.) */
html, body { overflow-x: clip; }

.fl-menu,
.fl-menu * { box-sizing: border-box; }

.fl-menu__hand {
  font-family: "Excalifont", "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
}

/* ---- bar ---------------------------------------------------------- */
.fl-menu {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--flm-cream, #FFFBF5);
  /* dashed wiggle border is drawn by an inline SVG; this is the fallback */
  border-bottom: 1.5px dashed rgba(44, 44, 42, 0.28);
}
.fl-menu__border {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 10px;
  display: block;
  pointer-events: none;
}

.fl-menu__inner {
  max-width: 72rem;
  margin: 0 auto;
  height: 64px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ---- brand -------------------------------------------------------- */
.fl-menu__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--flm-ink);
  flex-shrink: 0;
}
.fl-menu__brand img {
  width: 38px;
  height: 38px;
  filter: drop-shadow(2px 3px 0 rgba(44, 44, 42, 0.10));
}
.fl-menu__wordmark {
  font-size: 1.18rem;
  letter-spacing: 0.02em;
  transform: rotate(-0.5deg);
  display: inline-block;
  line-height: 1;
}

/* ---- centre nav (desktop) ---------------------------------------- */
.fl-menu__nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex: 1;
}
.fl-menu__link {
  position: relative;
  font-size: 1.05rem;
  color: var(--flm-ink);
  text-decoration: none;
  padding: 4px 2px;
  cursor: pointer;
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: rotate(-0.4deg);
}
.fl-menu__link:nth-child(even) { transform: rotate(0.4deg); }
.fl-menu__link::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -1px;
  height: 0.28em;
  background: var(--flm-teal-soft);
  z-index: -1;
  transform: rotate(-0.5deg) scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: url(#fl-menu-wiggle);
}
.fl-menu__link:hover,
.fl-menu__link.is-active { color: var(--flm-teal-dark); }
.fl-menu__link:hover::after,
.fl-menu__link.is-active::after { transform: rotate(-0.5deg) scaleX(1); }

.fl-menu__caret { transition: transform 0.2s ease; }
.fl-menu__courses.is-open .fl-menu__caret { transform: rotate(180deg); }

/* ---- courses dropdown -------------------------------------------- */
.fl-menu__courses { position: relative; }
.fl-menu__dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: -12px;
  width: 280px;
  background: #FFFBF5;
  border: 2px dashed var(--flm-ink);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 3px 5px 0 rgba(44, 44, 42, 0.10), 8px 12px 26px -8px rgba(44, 44, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.fl-menu__courses.is-open .fl-menu__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.fl-menu__ditem {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  text-decoration: none;
  color: var(--flm-ink);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.fl-menu__ditem:hover { background: rgba(46, 196, 182, 0.12); }
.fl-menu__ditem-name { font-size: 1.02rem; line-height: 1.15; }
.fl-menu__ditem-price {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--flm-ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.fl-menu__ditem--bundle .fl-menu__ditem-name { color: var(--flm-teal-dark); }
.fl-menu__ditem--bundle { background: rgba(46, 196, 182, 0.08); }
.fl-menu__dsep {
  height: 0;
  border-top: 1.5px dashed rgba(44, 44, 42, 0.30);
  margin: 6px 10px;
}
.fl-menu__dall {
  display: block;
  text-align: center;
  padding: 8px;
  margin-top: 4px;
  text-decoration: none;
  color: var(--flm-teal-dark);
  font-size: 0.95rem;
}
.fl-menu__dall:hover { text-decoration: underline; }

/* ---- right CTA cluster (desktop) --------------------------------- */
.fl-menu__cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* hand-drawn start button: SVG blob behind, text on top (filter never touches text) */
.fl-menu__start {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  text-decoration: none;
  color: var(--flm-cream);
  font-size: 1.02rem;
  letter-spacing: 0.005em;
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.fl-menu__start:hover { transform: translateY(-1px) scale(1.02); }
.fl-menu__start:active { transform: translateY(0) scale(0.985); }
.fl-menu__start-blob {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: url(#fl-menu-wiggle);
  pointer-events: none;
}
.fl-menu__start-label { position: relative; z-index: 1; line-height: 1; white-space: nowrap; }

/* ---- hamburger (mobile) ------------------------------------------ */
.fl-menu__burger {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--flm-ink);
}

/* ---- mobile drawer ----------------------------------------------- */
.fl-menu__scrim {
  position: fixed;
  inset: 0;
  overflow: hidden; /* clips the off-screen (closed) drawer so it can't create horizontal page overflow */
  background: rgba(44, 44, 42, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
  z-index: 60;
}
.fl-menu__scrim.is-open { opacity: 1; visibility: visible; }
.fl-menu__drawer {
  position: absolute; /* contained by the fixed scrim; scrim's overflow:hidden clips it off-screen so it can't widen the page */
  top: 0;
  right: 0;
  bottom: 0;
  width: min(82vw, 340px);
  background: var(--flm-cream, #FFFBF5);
  border-left: 2px dashed var(--flm-ink, #2C2C2A);
  padding: 20px 22px;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 61;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.fl-menu__scrim.is-open .fl-menu__drawer { transform: translateX(0); }
.fl-menu__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fl-menu__drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--flm-ink);
  padding: 6px;
  font-size: 1.6rem;
  line-height: 1;
}
.fl-menu__dlabel {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flm-teal-dark);
  margin: 16px 0 6px;
}
.fl-menu__dlink {
  font-size: 1.25rem;
  color: var(--flm-ink);
  text-decoration: none;
  padding: 9px 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px dashed rgba(44, 44, 42, 0.18);
}
.fl-menu__dlink:last-of-type { border-bottom: none; }
.fl-menu__dlink .fl-menu__ditem-price { font-size: 0.85rem; }
.fl-menu__dlink--bundle { color: var(--flm-teal-dark); }
.fl-menu__drawer-cta { margin-top: 22px; }

/* ---- responsive switch ------------------------------------------- */
@media (max-width: 860px) {
  .fl-menu__nav,
  .fl-menu__cta { display: none; }
  .fl-menu__burger { display: inline-flex; }
  .fl-menu__inner { height: 56px; gap: 0.75rem; }
  .fl-menu__wordmark { font-size: 1.08rem; }
}
@media (min-width: 861px) {
  .fl-menu__scrim { display: none; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fl-menu__link::after,
  .fl-menu__dropdown,
  .fl-menu__drawer,
  .fl-menu__scrim,
  .fl-menu__start { transition: none; }
}
