/* Phone menu, the same on every page (scripts/apply-menu.py writes the markup). 2026-10-27.
   Full screen, black with a soft light from the top corner, big links with their numbers, the current page marked,
   then the audit button, tap-to-call and email, and the NYC clock. Links rise in one after another. */

#menu.menu { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; gap: 18px;
  padding: calc(84px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background: radial-gradient(120% 55% at 100% 0%, rgba(255,255,255,.08), transparent 62%), #060606;
  color: #fff; overflow-y: auto; overscroll-behavior: contain; mix-blend-mode: normal; opacity: 1; visibility: visible; transform: none; }
#menu.menu[hidden] { display: none; }
/* The logo and the menu button stay on top, so the same button closes the menu */
.nav [data-menu-toggle], .nav .nav__brand { position: relative; z-index: 61; }
#menu.menu::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.018) 3px 4px); }

#menu .menu__top { margin: 0; display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.16);
  font: 500 11px/1.4 var(--f-mono, var(--mono, monospace)); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }

#menu .menu__list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 0; }
#menu .menu__list li { border-bottom: 1px solid rgba(255,255,255,.1); }
#menu .menu__link { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 8px;
  padding: 13px 0; min-height: 52px; text-decoration: none; color: rgba(255,255,255,.82);
  font: 600 32px/1 var(--f-display, var(--display, sans-serif)); letter-spacing: -.02em; transition: color .25s, transform .35s cubic-bezier(.16,1,.3,1); }
#menu .menu__link .label { align-self: center; font: 500 12px/1 var(--f-mono, var(--mono, monospace)) !important; letter-spacing: .1em; color: rgba(255,255,255,.45); }
#menu .menu__arrow { width: 14px; height: 14px; opacity: .35; transition: opacity .25s, transform .35s cubic-bezier(.16,1,.3,1); }
#menu .menu__link:active, #menu .menu__link:hover { color: #fff; transform: translateX(4px); }
#menu .menu__link:active .menu__arrow, #menu .menu__link:hover .menu__arrow { opacity: 1; transform: translateX(3px); }
#menu .menu__link[aria-current="page"] { color: #fff; }
#menu .menu__link[aria-current="page"] .label { color: #fff; }
#menu .menu__link[aria-current="page"]::before { content: ""; position: absolute; left: -20px; top: 50%; width: 3px; height: 26px; margin-top: -13px; background: #fff; }

#menu .menu__foot { display: grid; gap: 12px; }
#menu .menu__cta { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 20px; background: #fff; color: #000;
  font: 500 15px/1 var(--f-sans, var(--body, sans-serif)); text-decoration: none; border: 1px solid #fff; }
#menu .menu__cta .menu__arrow { opacity: 1; }
#menu .menu__cta:active { background: transparent; color: #fff; }
#menu .menu__note { margin: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.55); }
#menu .menu__contact { margin: 4px 0 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255,255,255,.12); }
#menu .menu__contact a { display: flex; align-items: center; justify-content: center; min-height: 48px; font-size: 14px; color: #fff; text-decoration: none; }
#menu .menu__contact a + a { border-left: 1px solid rgba(255,255,255,.12); }
#menu .menu__clock { margin: 0; display: flex; align-items: center; gap: 8px; font: 500 11px/1.4 var(--f-mono, var(--mono, monospace)); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
#menu .menu__clock b { color: #fff; font-weight: 500; }
#menu .menu__clock span:last-child { margin-left: auto; }
#menu .menu__clock .dot { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }

/* Opening: the panel fades in, the links rise one after another, then the footer */
#menu.menu:not([hidden]) { animation: vmenu-in .35s ease both; }
#menu.menu:not([hidden]) .menu__list li, #menu.menu:not([hidden]) .menu__foot { animation: vmenu-rise .6s cubic-bezier(.16,1,.3,1) both; }
#menu .menu__list li:nth-child(1) { animation-delay: .06s; }
#menu .menu__list li:nth-child(2) { animation-delay: .10s; }
#menu .menu__list li:nth-child(3) { animation-delay: .14s; }
#menu .menu__list li:nth-child(4) { animation-delay: .18s; }
#menu .menu__list li:nth-child(5) { animation-delay: .22s; }
#menu .menu__list li:nth-child(6) { animation-delay: .26s; }
#menu .menu__list li:nth-child(7) { animation-delay: .30s; }
#menu.menu:not([hidden]) .menu__foot { animation-delay: .34s; }
@keyframes vmenu-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vmenu-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #menu.menu, #menu .menu__list li, #menu .menu__foot { animation: none !important; } }

/* Short phones: everything still fits without scrolling */
@media (max-height: 700px) {
  #menu.menu { gap: 12px; padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
  #menu .menu__link { font-size: 27px; padding: 9px 0; min-height: 44px; }
  #menu .menu__cta { min-height: 48px; }
  #menu .menu__note { display: none; }
}

/* While the menu is open, the homepage's Skip intro box steps aside (it sits on its own layer above the bar) */
html:has(#menu:not([hidden])) .skip-intro { opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }

/* Tap targets (design pass, 2026-10-27). Buttons and form fields: at least 44px at every width. Heights are not
   mirrored for laptops; widths use max(44px, ...) so the laptop mirror keeps the floor. */
html body .btn--sm, html body .pill, html body button.chip, html body .dtable button.th { min-height: 44px !important; }
html body .dtable button.th { min-width: max(44px, 2.75rem); }
html body .round { width: max(44px, 2.75rem); height: 44px; }
/* Phones: the menu button stays at the right edge when the header condenses and the clock hides */
@media (max-width: 1023px) { html body .nav .nav__menu { margin-left: auto !important; } }
/* Contact: the spam check gets its own row (hidden while empty), so the send button lines up with the fields */
html body .form__foot .turnstile { flex-basis: 100%; }
html body .form__foot .turnstile:empty { display: none; }
@media (max-width: 600px) { html body .more > summary { flex-wrap: wrap; row-gap: 0; } html body .more > summary .muted { flex-basis: 100%; margin-left: 1.8rem; font-weight: 400; } }
/* Demos index: each preview grows to fit its content instead of spilling onto "Run the demo" */
html body .dix__pv { height: auto !important; min-height: 230px; }
/* Home: the chapter label on the top progress rail ran into the header bar on laptops; the bottom-left chapter readout already says the same */
html body .progress__label { display: none !important; }
/* Systems on phones: the "Guide" label sits on its own line so its links line up */
@media (max-width: 600px) { html body .sysrow__guide .label { flex-basis: 100%; } }
/* Radar: the reply-time line gets the same breathing room as on Info */
html body .rd-micro { margin-top: .75rem; }
/* No 300ms tap delay on any control */
html body a, html body button, html body summary, html body [role="button"] { touch-action: manipulation; }
/* Text floor: nothing under 12px (the demo banner was 11.5px) */
html body .demo__banner { font-size: 12px !important; }
html body .field input, html body .field select, html body .field textarea { min-height: 44px !important; }
/* Desktop floor (24px, WCAG 2.5.8): small stand-alone links get an invisible tap area; nothing moves */
html body .guide__crumbs a, html body a.guide__fact-src, html body .hero__fn { position: relative; }
html body .guide__crumbs a::before, html body a.guide__fact-src::before, html body .hero__fn::before { content: ""; position: absolute; top: -4px; right: 0; bottom: -4px; left: 0; }
/* Stand-alone text links on phones and touch screens: each row at least 44px tall. Desktop mice keep the tighter lists. */
@media (pointer: coarse), (max-width: 1023px) {
  html body .footer__grid a, html body .footer__law a, html body .guide__crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  html body .footer__grid a, html body .footer__law a { min-width: max(44px, 2.75rem); }
  /* List rows grow instead of the links, so the list number stays on the first line; the link covers its row */
  html body .guide__toc li, html body .guide__src li { position: relative; padding-block: 11px; }
  html body .guide__toc li a::before, html body .guide__src li a::before { content: ""; position: absolute; inset: 0; }
  /* 8px between neighboring tap targets (touch-spacing) */
  html body .guide__toc li { margin: 0; }
  html body .guide__toc ol { gap: 8px; }
  html body .guide__src li { margin: 0; }
  html body .guide__src li + li { margin-top: 8px; }
  html body .footer__grid ul { gap: 8px; }
  html body a.guide__fact-src { padding: 13px 0; margin: -10px 0; }
  /* Underlined links keep their look: an invisible tap area around them instead */
  html body .tlink, html body .hero__fn, html body a.source, html body .addr a, html body a.num, html body .nav__brand { position: relative; }
  html body .tlink::before, html body .hero__fn::before, html body a.source::before, html body .addr a::before, html body a.num::before, html body .nav__brand::before { content: ""; position: absolute; top: -14px; right: 0; bottom: -14px; left: 0; }
  html body .nav__brand::before { top: -16px; bottom: -16px; }
  html body .footer__grid a::before, html body .direct a::before { content: none; }  /* footer rows are already 44px; a grown area would reach the link above */
  html body .direct a { display: inline-flex; align-items: center; min-height: 44px; }
  html body .guide__crumbs { display: flex; flex-wrap: wrap; align-items: center; }
  html body .guide__crumbs a::before { left: -4px; right: -4px; }
}

/* Demos page previews on laptops: the page scales to 70% but preview text keeps its 12px floor, so the preview
   column keeps a readable width (max() is left as is by the laptop mirror) and the rows size their columns to the
   text (ch), so worker IDs and client codes no longer run together and Radar names stay on one line. */
@media (min-width: 1024px) and (max-width: 1919px) {
  .dix__row[data-astro-cid-i6i4fcnf] { grid-template-columns: 4.5rem minmax(0, 1fr) max(400px, 0px) !important; }
  .pv-ll__r[data-astro-cid-7cytj3ng] { grid-template-columns: 6ch 8.5ch 4.5ch minmax(0, 1fr) !important; }
  .pv-rd__r { grid-template-columns: minmax(0, 1.4fr) 8.5ch 1.2rem minmax(0, 1fr) !important; }
}
