/* nav.css -- the header of every landing page (sprint landing-next-7, 2026-11-09).
 *
 * Loaded LAST on each page, because index (page-index.css) and the other pages (site.css) each carry their own
 * .nav rules and share only tokens.css. Colours are tokens.css names only (tools/check-tokens.sh).
 *
 * THE BAR IS STICKY AND NEVER CHANGES ITS LAYOUT HEIGHT. A sticky box stays in the flow, so its place is reserved
 * by construction and no spacer exists. The compact state is two transforms: the bar goes up by --nav-lift
 * (rest height minus 56px, set by nav.js from the measured height, which is 84px on index and 72px on the other
 * pages under 760px) and its content comes back down by half of that, so it stays centred in the 56px left visible.
 * Nothing here relayouts this page on the switch: the hero and the films stay within their frame budget.
 *
 * The bar has to be a direct child of body on index: inside .page it would stop at the end of the hero.
 * Scroll lock goes on body, never on html: html with an overflow makes body (overflow-x hidden on index) a scroll
 * container of its own, and the sticky bar would then leave the screen. */
:root { --nav-compact: 56px; }

[id] { scroll-margin-top: var(--nav-compact); }

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--panel);
  transition: transform var(--dur-base) var(--ease-standard);
}
.nav > * { transition: transform var(--dur-base) var(--ease-standard); }
.nav.is-compact { transform: translateY(calc(var(--nav-lift, 0px) * -1)); }
.nav.is-compact > * { transform: translateY(calc(var(--nav-lift, 0px) / 2)); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav, .nav > * { transition: none; }
}

/* ── The outlined button, the same box as .btn-signin: its 9px and 18px less the 1px border ── */
.btn-dashboard {
  display: inline-block;
  font-size: 13px;
  font-weight: var(--fw-medium);
  padding: 8px 17px;
  white-space: nowrap;
  color: var(--green-dark);
  background: transparent;
  border: 1px solid var(--green-dark);
  border-radius: var(--radius-control);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.btn-dashboard:hover { background: var(--green-dark); color: var(--white); }
/* The same specificity as the two .nav-links a:not(.btn-signin) rules: this file comes last, so these win. */
.nav-links a.btn-dashboard { font-size: 13px; color: var(--green-dark); }
.nav-links a.btn-dashboard:hover { color: var(--white); }

/* ── Features: the dropdown (900px and up) ── */
.nav-menu { position: relative; display: flex; align-items: center; }
.nav-features {
  font-family: inherit;
  font-size: 14px;
  line-height: inherit;
  color: var(--slate);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.nav-features:hover, .nav-menu.is-open .nav-features { color: var(--charcoal); }
.nav-drop {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  margin-top: 10px;
  min-width: 210px;
  padding: 6px;
  background: var(--panel);
  border: var(--hairline);
  border-radius: var(--radius-control);
}
.nav-menu.is-open .nav-drop { display: block; }
.nav-links .nav-drop a { display: block; padding: 7px 10px; white-space: nowrap; border-radius: var(--radius-control); }
.nav-links .nav-drop a.is-current { color: var(--green-dark); font-weight: var(--fw-medium); }

/* ── Menu: the phone panel (under 900px) ── */
.nav-menu-btn {
  display: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--charcoal);
  background: none;
  border: var(--hairline);
  border-radius: var(--radius-control);
  padding: 0 10px;
  min-width: 44px;
  min-height: 44px;
  /* 44px to touch, with no more height in the bar than the 39px button beside it. */
  margin-block: -3px;
  cursor: pointer;
}
.nav-panel {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--nav-panel-top, 56px);
  max-height: calc(100vh - var(--nav-panel-top, 56px));
  max-height: calc(100dvh - var(--nav-panel-top, 56px));
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 59;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-bottom: var(--hairline);
}
.nav-panel.is-open { display: block; }
.nav-panel-links { list-style: none; margin: 0; padding: 0; }
.nav-panel-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--slate);
  text-decoration: none;
}
.nav-panel-links a.is-current { color: var(--green-dark); font-weight: var(--fw-medium); }
.nav-panel-links .nav-panel-sep { border-top: var(--hairline); margin-top: 6px; padding-top: 6px; }
.nav-panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.nav-panel-actions a { flex: 1 1 auto; text-align: center; }
.nav-label-short { display: none; }
.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 58;
  background: var(--charcoal);
  opacity: 0.25;
}
.nav-scrim.is-open { display: block; }
body.nav-locked { overflow: hidden; }

.nav a:focus-visible, .nav button:focus-visible, .nav-panel a:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}

/* Seven controls in the bar: tighter between the phone layout and a wide screen. */
@media (min-width: 900px) and (max-width: 1099px) {
  .nav { padding-left: 24px; padding-right: 24px; }
  .nav-links { gap: 16px; }
}

@media (max-width: 899px) {
  .nav { padding-left: 16px; padding-right: 16px; gap: 10px; }
  .nav-links { gap: 10px; }
  .nav-links a:not(.btn-signin), .nav-menu { display: none; }
  .nav-menu-btn { display: inline-block; }
}
@media (min-width: 900px) {
  .nav-panel.is-open, .nav-scrim.is-open { display: none; }
}
/* The two buttons need 342px with the long label; the panel's row is the width less 32px. */
@media (max-width: 379px) {
  .nav-label-long { display: none; }
  .nav-label-short { display: inline; }
}

@media print {
  .nav { position: static; transform: none; }
}
