/* Design v6: the frame the v6 pages share (site-src/v6/layout.mjs): the skip link, the sticky header, the footer, and the page-to-page
   transition. Written in each page's own tokens (Home's or For businesses'), so the frame sits in the page's own colours and faces.
   The header (the owner's decision of 22 November 2026; docs/design-v6/home/ART.md 4.1, MOTION.md 2.1): the wordmark (the P alone below
   440 px), For businesses, Free tools, About (from 900 px), one button, "Tell us your problem", and Menu (below 900 px). Its layout box
   is always the compact height (52 px, 56 from 768); the tall state (60 px, 72 from 768) is drawn with transform: the solid bar scales
   from its top, the row moves down by half the difference and the wordmark is a touch larger. assets/js/v6/frame.js sets data-compact
   once a mark one screen down has gone past the top, so compacting moves nothing on the page and runs on the compositor. The phone's
   menu is a popover (it opens without JavaScript): the popover is a clipping window under the bar and its panel slides down inside it,
   so no word ever fades. */

:root { --mast-h: 3.25rem; --mast-k: 1.2308; --mast-dy: 0.375rem; --mast-logo-k: 1.1667; }
@media (min-width: 440px) { :root { --mast-logo-k: 1.1111; } }
@media (min-width: 768px) { :root { --mast-h: 3.5rem; --mast-k: 1.2857; --mast-dy: 0.5rem; --mast-logo-k: 1.2222; } }

.skip { position: absolute; left: var(--s4); top: var(--s2); z-index: 60; display: inline-flex; align-items: center; min-height: 3rem; padding: 0 var(--s5); border-radius: 10px; background: var(--ask-bg, var(--btn-bg)); color: var(--ask-text, var(--btn-text)); font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ───────── the header ───────── */
.mast { position: sticky; top: 0; z-index: 50; height: var(--mast-h); view-transition-name: mast; }
.mast::before { content: ""; position: absolute; inset: 0; background: var(--bg); transform-origin: 50% 0; transform: scaleY(var(--mast-k)); transition: transform var(--dur-base) var(--ease-enter, var(--ease-out)); }
.mast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity var(--dur-base) var(--ease-enter, var(--ease-out)); }
.mast-in { position: relative; display: flex; align-items: center; gap: var(--s2); height: 100%; transform: translateY(var(--mast-dy)); transition: transform var(--dur-base) var(--ease-enter, var(--ease-out)); }
.mast[data-compact]::before { transform: none; }
.mast[data-compact]::after { opacity: 1; }
.mast[data-compact] .mast-in { transform: none; }
.mast[data-compact] .mast-home img { transform: none; }
.mast-mark { position: absolute; top: 100svh; left: 0; width: 1px; height: 1px; pointer-events: none; }

.mast-home { display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap); margin-right: auto; }
.mast-home img { width: 15px; height: 24px; transform-origin: 0 50%; transform: scale(var(--mast-logo-k)); transition: transform var(--dur-base) var(--ease-enter, var(--ease-out)); }
@media (min-width: 440px) { .mast-home img { width: 113px; height: 18px; } }

.mast-nav ul { display: flex; gap: var(--s1); }
.mast-nav a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); padding-inline: var(--s3); color: var(--text-2); font-size: var(--t-ui); font-weight: 600; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.mast-nav a span { position: relative; }
.mast-nav a span::after { content: ""; position: absolute; left: 0; right: 0; bottom: -0.5rem; height: 2px; background: var(--text-2); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-quick) var(--ease-enter, var(--ease-out)); }
.mast-nav a[aria-current] { color: var(--text); }
.mast-nav a[aria-current] span::after { background: var(--signal, var(--text)); transform: none; }

.mast-ask { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: 10px; background: var(--ask-bg, var(--btn-bg)); color: var(--ask-text, var(--btn-text)); font-size: 0.9375rem; font-weight: 600; line-height: 1.25; text-decoration: none; white-space: nowrap; transition: transform var(--dur-quick) var(--ease-enter, var(--ease-out)); }
.mast-ask::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--ask-hover, var(--btn-hover)); opacity: 0; transition: opacity var(--dur-quick) var(--ease-enter, var(--ease-out)); }
.mast-ask:active { transform: scale(0.97); }
@media (min-width: 768px) { .mast-ask { padding: 0 var(--s4); font-size: var(--t-ui); } }
/* (under 390 px its words may wrap and its sides are 2 px narrower: they fit one line, and under a reader's own text spacing they take
   two rather than push Menu off the screen or over its own edge; WCAG 1.4.12) */
@media (max-width: 389.98px) { .mast-ask { white-space: normal; text-align: center; padding: 0 var(--s2); } }

.mast-menu { flex-shrink: 0; display: inline-flex; align-items: center; gap: var(--s2); min-width: var(--tap); min-height: var(--tap); padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: 10px; background: none; color: var(--text); font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.mast-menu-icon { position: relative; display: none; width: 14px; height: 10px; }
.mast-menu-icon i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 1px; background: currentColor; transition: transform var(--dur-base) var(--ease-morph, var(--ease-in-out)); }
.mast-menu-icon i:first-child { top: 0; }
.mast-menu-icon i:last-child { bottom: 0; }
@media (min-width: 360px) { .mast-menu-icon { display: block; } }
.mast:has(.mast-sheet:popover-open) .mast-menu-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.mast:has(.mast-sheet:popover-open) .mast-menu-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* the phone's menu: the popover is the window under the bar (transparent, clipping); its panel slides down inside it, its rows follow */
/* (the window scrolls when the panel is taller than it, on a landscape phone or at 400% zoom, and its scrolling stays inside it: it had
   clipped the last items, Tab still reaching them; the accessibility audit's A3) */
.mast-sheet { position: fixed; inset: calc(var(--mast-h) * var(--mast-k)) 0 0 0; width: auto; max-width: none; height: auto; margin: 0; padding: 0; border: 0; background: none; color: var(--text); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transition: overlay var(--dur-base) allow-discrete, display var(--dur-base) allow-discrete; }
.mast[data-compact] .mast-sheet { top: var(--mast-h); }
.mast-panel { background: var(--menu-bg, var(--bg)); border-bottom: 1px solid var(--line); transform: translateY(-100%); transition: transform var(--dur-base) var(--ease-morph, var(--ease-in-out)); }
.mast-sheet:popover-open .mast-panel { transform: none; transition-timing-function: var(--ease-enter, var(--ease-out)); }
@starting-style { .mast-sheet:popover-open .mast-panel { transform: translateY(-100%); } }
/* the page under the menu dims (a layer of the page colour, no words), the bar above it never does: the dim is the window's own layer */
.mast-sheet::backdrop { background: none; }
.mast-sheet::before { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: 0; transition: opacity var(--dur-base) var(--ease-morph, var(--ease-in-out)); }
.mast-sheet:popover-open::before { opacity: 0.6; }
@starting-style { .mast-sheet:popover-open::before { opacity: 0; } }
.mast-panel { position: relative; }
.mast-sheet-in { display: grid; padding-top: var(--s4); padding-bottom: var(--s6); }
.mast-sheet-in > * { transform: translateY(-0.75rem); transition: transform var(--dur-base) var(--ease-enter, var(--ease-out)); }
.mast-sheet:popover-open .mast-sheet-in > * { transform: none; }
.mast-sheet:popover-open .mast-sheet-in > :nth-child(2) { transition-delay: 50ms; }
.mast-sheet:popover-open .mast-sheet-in > :nth-child(3) { transition-delay: 100ms; }
@starting-style { .mast-sheet:popover-open .mast-sheet-in > * { transform: translateY(-0.75rem); } }
.mast-sheet-mark { margin-bottom: var(--s3); }
.mast-sheet-mark img { width: 126px; height: 20px; }
.mast-sheet ul a { display: flex; align-items: center; min-height: 4rem; border-bottom: 1px solid var(--line); color: var(--text); font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.mast-sheet ul a[aria-current] { text-decoration: underline 2px var(--signal, var(--text)); text-underline-offset: 0.2em; }
/* (the bar's button stays in view above the open menu, so the panel doesn't repeat it: the design critic's D20) */
.mast-sheet-mail a { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: var(--s4); color: var(--text-2); font-size: var(--t-ui); }

/* which parts show at which width (ART.md 4.1): the button at every width; Menu below 900 px; the three items from 900 px */
.mast-in > .mast-nav { display: none; }
@media (min-width: 900px) {
  .mast-in { gap: var(--s4); }
  .mast-in > .mast-nav { display: block; }
  .mast-menu, .mast-sheet { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  .mast-nav a:hover { color: var(--text); }
  .mast-nav a:hover span::after { transform: none; }
  .mast-ask:hover::before { opacity: 1; }
  .mast-menu:hover { border-color: var(--text); }
}

/* ───────── the footer (no giant wordmark; ART.md 4.8) ───────── */
.foot { font-size: var(--t-small); line-height: var(--lh-small); }
.foot-in { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s5); padding-top: var(--s8); padding-bottom: var(--s7); border-top: 1px solid var(--line); }
.foot-mark { grid-column: 1 / -1; }
.foot-mark img { width: 19px; height: 32px; }
.foot-nav ul, .foot-reach { display: grid; align-content: start; }
.foot-nav a, .foot-reach a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); color: var(--text-body); font-size: var(--t-ui); font-weight: 500; text-decoration: none; }
/* the address is never broken; under 440 px, where half the footer is narrower than it, the pages and the ways to reach us each take
   the footer's full width (the pages in two columns) */
.foot-reach a { white-space: nowrap; }
@media (max-width: 439.98px) {
  .foot-nav, .foot-reach { grid-column: 1 / -1; }
  .foot-nav ul { grid-template-columns: 1fr 1fr; column-gap: var(--s5); }
}
.foot-legal { grid-column: 1 / -1; display: grid; gap: var(--s1); padding-top: var(--s5); border-top: 1px solid var(--line); color: var(--text-2); }
.foot-small { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s4); }
.foot-small a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); color: var(--text-2); }
@media (min-width: 768px) { .foot-nav ul { grid-template-columns: 1fr 1fr; column-gap: var(--s5); } }
@media (min-width: 1024px) {
  .foot-in { grid-template-columns: repeat(12, minmax(0, 1fr)); padding-top: var(--s9); }
  .foot-mark { grid-column: 1 / 7; }
  .foot-nav { grid-column: 7 / 10; }
  .foot-reach { grid-column: 10 / 13; }
}
@media (hover: hover) and (pointer: fine) { .foot-nav a:hover, .foot-reach a:hover, .foot-small a:hover { text-decoration: underline 2px currentColor; text-underline-offset: 0.25em; } }

/* ───────── page to page (MOTION.md 2.8): no move. The cross-document View Transition (the new page rising 24 px over the old) left on
   23 November 2026: Chromium skipped it at random on the arriving page, even between two of these pages and in real Chrome, and threw an
   error there that no page script can catch ("Transition was aborted because of invalid state"); docs/design-v6/site/DECISIONS.md.
   The header's view-transition-name stays: it does nothing outside a transition. ───────── */
@media (forced-colors: active) { .mast-ask { border: 1px solid ButtonText; } }
