/* One header on every page, drawn to match the homepage's: the wordmark, the
   same five places and Sign in, the theme switch and Make a reel. The places sit in a row
   when they fit and behind Menu when they do not. The menu is a native
   disclosure, so it still opens without the script. */
/* Wraps as a last resort: with enlarged text on a phone, Make a reel takes a
   row of its own rather than running off the screen. */
.page-top { position: relative; flex-wrap: wrap; gap: 18px; }
.page-top .page-mark { gap: 9px; font-size: 16px; letter-spacing: -0.03em; }
/* The menu hangs from the header's right edge, not from the small button. */
.page-nav { position: static; margin-left: auto; flex: none; }
.page-nav > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 12px; white-space: nowrap; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.5; }
.page-nav > summary::-webkit-details-marker { display: none; }
.page-nav[open] > summary { color: var(--signal); border-color: var(--signal); }
.page-nav > summary:hover { border-color: var(--signal); }
.page-nav > summary:focus-visible, .page-nav a:focus-visible, .page-top .daynight:focus-visible, .page-top > a.page-start:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.page-nav nav { position: absolute; z-index: 20; right: 8px; top: calc(100% + 8px); width: min(220px, calc(100vw - 64px)); max-height: calc(100dvh - 120px); overflow: auto; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--lift); }
/* Closed, the list is not laid out at all: a closed disclosure still lays out
   its content inside itself, off to the side of the header. */
.page-nav:not([open]) > nav { display: none; }
.page-nav a { display: flex; align-items: center; justify-content: flex-start; min-height: 44px; padding: 10px 12px; color: var(--ink); font-size: 16px; line-height: 1.5; text-decoration: none; border-radius: 9px; max-width: 100%; }
.page-nav a:hover { background: var(--tint); }
.page-nav a[aria-current="page"] { font-weight: 600; }
.page-nav[data-wide] > summary { display: none; }
/* Until the script sees a row that no longer fits, it wraps rather than
   running past the edge. */
.page-nav[data-wide] { flex: 0 1 auto; min-width: 0; }
.page-nav[data-wide] nav { position: static; width: auto; max-height: none; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.page-nav[data-wide] a { padding: 0; font-size: 14px; color: var(--muted); border-radius: 0; white-space: nowrap; }
.page-nav[data-wide] a:hover { background: none; color: var(--ink); }
.page-nav[data-wide] a[aria-current="page"] { color: var(--ink); font-weight: 500; }
/* Sign in is not a place on the site but the way back to somebody's own
   reels: under a rule at the end of the menu, and after a rule in the row,
   in ink beside Make a reel. */
.page-nav a.nav-account { position: relative; margin-top: 9px; }
.page-nav a.nav-account::before { content: ""; position: absolute; left: 12px; right: 12px; top: -6px; border-top: 1px solid var(--rule); }
.page-nav[data-wide] a.nav-account { margin-top: 0; color: var(--ink); font-weight: 600; }
.page-nav[data-wide] a.nav-account::before { left: -10px; right: auto; top: 50%; height: 18px; margin-top: -9px; border-top: 0; border-left: 1px solid var(--rule); }
/* On a tablet the row has room for the five places and not for Sign in too.
   It waits there rather than folding all five behind Menu, and Make a reel
   leads to the same sign-in. */
@media (max-width: 899px) { .page-nav[data-wide] a.nav-account { display: none; } }

.page-top .daynight { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; }
.page-top .daynight:hover { color: var(--ink); border-color: var(--signal); }
.page-top .daynight[hidden] { display: none; }
.page-top .daynight svg { width: 16px; height: 16px; display: block; }
.page-top .daynight .sun, .page-top .daynight .rays { display: none; }
.page-top .daynight .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-top .daynight .moon { display: none; }
  :root:not([data-theme="light"]) .page-top .daynight .sun, :root:not([data-theme="light"]) .page-top .daynight .rays { display: block; }
}
:root[data-theme="dark"] .page-top .daynight .moon { display: none; }
:root[data-theme="dark"] .page-top .daynight .sun, :root[data-theme="dark"] .page-top .daynight .rays { display: block; }

/* Make a reel is the homepage's own button, filled and always in reach. */
.page-top > a.page-start { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 16px; border: 0; border-radius: 999px; background: var(--fill); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.5; text-decoration: none; white-space: nowrap; box-shadow: 0 10px 28px -10px rgba(61, 58, 245, 0.55); }

@media (max-width: 560px) { .page-top { gap: 8px; } }
/* A narrow phone keeps the mark and gives its word to the controls, as the
   homepage does at the same width. */
@media (max-width: 360px) {
  .page-top { padding-inline: 8px; gap: 6px; }
  .page-top .page-mark { gap: 0; min-width: 44px; justify-content: center; }
  /* Out of sight only: the word is still the link's name. */
  .page-top .page-mark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .page-top > a.page-start { padding-inline: 10px; }
  .page-nav > summary { padding-inline: 10px; }
}

/* The first stop for a keyboard: past the header's seven controls to what the
   page is for. Out of sight until it has the focus, then a pill at the top. */
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; left: 16px; top: 12px; min-height: 44px; display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--ground); font-family: var(--display); font-size: 14px; font-weight: 600; text-decoration: none; outline: 2px solid var(--signal); outline-offset: 2px; }
