@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&display=swap");
/* Shared site header and language menu, used by every page.
   Selectors carry an element or second class so they win over each page's
   own build CSS, which styles the same elements differently. */

/* ---------- Header bar ----------
   A floating, rounded glass bar (2026-12-02). It sits 12px below the top of the
   page and stays there while the page scrolls under it. --pp-head-h is the room
   it takes in the page flow, so a page can slide its first section under it. */
:root { --pp-head-h: 70px; }
header.pp-header {
  --pp-pad: 14px;
  position: sticky; top: 12px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  box-sizing: border-box;
  width: min(1160px, calc(100% - 24px));
  height: 58px; min-height: 58px; margin: 12px auto 0;
  padding: 0 8px 0 var(--pp-pad);
  color: #0f1a33;
  background: #fffffff2;
  border: 1px solid #ffffffe6; border-radius: 999px;
  box-shadow: 0 0 0 1px #0f1a330f, 0 10px 30px -12px #0f1a3347;
  font: 500 14px/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header.pp-header {
    background: #ffffffb8;
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    backdrop-filter: saturate(1.4) blur(16px);
  }
}

header.pp-header .pp-brand {
  display: inline-flex; align-items: center; gap: 9px;
  width: auto; height: auto; min-height: 40px;
  margin: 0; margin-inline-start: -8px; padding: 0 10px 0 8px;
  border-radius: 999px;
  color: #0f1a33; text-decoration: none; white-space: nowrap;
  font: 700 17px/1 "Bricolage Grotesque", Inter, system-ui, sans-serif; letter-spacing: -.02em;
}
header.pp-header .pp-brand svg { width: 24px; height: 19px; flex: none; color: #e0303a; }
header.pp-header .pp-brand span { display: inline; }
header.pp-header .pp-brand:hover { background: #0f1a330d; }

header.pp-header .pp-nav {
  display: flex; align-items: center; gap: 2px;
  margin: 0; margin-inline-start: 6px;
}
header.pp-header .pp-nav a {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  color: #55617a; background: none;
  font: 500 14px/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none; white-space: nowrap;
}
header.pp-header .pp-nav a:hover { color: #0f1a33; background: #0f1a330f; }
header.pp-header .pp-nav a[aria-current="page"] { color: #0f1a33; background: #0f1a3314; }

header.pp-header a:focus-visible,
header.pp-header button:focus-visible,
header.pp-header input:focus-visible {
  outline: 2px solid #2f6bff; outline-offset: 2px;
}

/* The language control always sits at the far end of the bar */
header.pp-header .pp-lang { margin-inline-start: auto; }
header.pp-header label.lang-menu { display: none; }

@media (width <= 600px) {
  :root { --pp-head-h: 66px; }
  header.pp-header { gap: 4px; top: 8px; width: calc(100% - 16px); margin-top: 8px; --pp-pad: 12px; }
  /* Icon only, but keep the name for screen readers */
  header.pp-header .pp-brand span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  header.pp-header .pp-nav { margin-inline-start: 2px; }
  header.pp-header .pp-nav a { padding: 0 9px; }
}
@media (width <= 360px) {
  header.pp-header .pp-nav a { padding: 0 7px; font-size: 13.5px; }
}

@media (prefers-reduced-motion: no-preference) {
  header.pp-header .pp-brand,
  header.pp-header .pp-nav a,
  .pp-lang-btn, .pp-lang-opt { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
}

/* ---------- Language menu ---------- */
.pp-lang { position: relative; display: inline-flex; }
.pp-lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px 0 9px; margin: 0;
  border: 1px solid #0f1a331f; border-radius: 999px;
  background: #ffffff99; color: #0f1a33;
  font: 500 13.5px/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap; cursor: pointer;
}
.pp-lang-btn:hover { background: #fff; border-color: #0f1a3333; }
.pp-lang-btn[aria-expanded="true"] { background: #fff; border-color: #0f1a3340; }
.pp-lang-btn .pp-globe { width: 16px; height: 16px; flex: none; opacity: .85; }
.pp-lang-btn .pp-chev { width: 10px; height: 10px; flex: none; opacity: .7; }
.pp-lang-btn[aria-expanded="true"] .pp-chev { transform: rotate(180deg); }
.pp-lang-code { display: none; letter-spacing: .02em; }
@media (width <= 600px) {
  .pp-lang-name { display: none; }
  .pp-lang-code { display: inline; }
  .pp-lang-btn { padding: 0 8px; gap: 5px; }
}

.pp-lang-pop {
  position: fixed; z-index: 1000; box-sizing: border-box;
  width: min(400px, calc(100vw - 16px));
  max-height: min(500px, calc(100dvh - 80px));
  overflow: auto; overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid #0f1a3314; border-radius: 18px;
  background: #fff; color: #0f1a33;
  box-shadow: 0 28px 64px -18px #0f1a3359, 0 6px 16px #0f1a331f;
  font: 14px/1.25 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin; scrollbar-color: #0f1a3329 transparent;
}
.pp-lang-pop[hidden] { display: none; }
.pp-lang-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 10px 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: #6b7790;
}
.pp-lang-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px;
}
.pp-lang-opt {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  min-height: 48px; padding: 7px 34px 7px 11px; border-radius: 9px;
  cursor: pointer; outline: none; user-select: none;
}
[dir="rtl"] .pp-lang-opt { padding: 7px 11px 7px 34px; }
/* physical sides: the page sets svg { direction: ltr } in RTL */
[dir="rtl"] .pp-lang-opt .pp-ck { right: auto; left: 11px; }
.pp-lang-opt .pp-n { font-weight: 500; color: #0f1a33; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-lang-opt .pp-s { font-size: 12px; color: #6b7790; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-lang-opt .pp-ck {
  position: absolute; right: 11px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; color: #e0303a; opacity: 0;
}
.pp-lang-opt:hover { background: #0f1a330a; }
.pp-lang-opt:focus-visible { background: #0f1a330a; box-shadow: inset 0 0 0 2px #2f6bff; }
.pp-lang-opt[aria-selected="true"] { background: #2f6bff12; }
.pp-lang-opt[aria-selected="true"] .pp-n { color: #0f1a33; font-weight: 600; }
.pp-lang-opt[aria-selected="true"] .pp-ck { opacity: 1; }
.pp-lang-opt[aria-busy="true"] .pp-ck { opacity: 1; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  .pp-lang-btn .pp-chev { transition: transform .18s ease; }
  .pp-lang-pop:not([hidden]) { animation: pp-lang-in .16s cubic-bezier(.2, .8, .2, 1); transform-origin: var(--pp-origin, top right); }
}
@keyframes pp-lang-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- Simulator (lab.html) ----------
   Its header also holds the plane name and tools. Kept here, next to the bar's own
   colours, so a cached page and a fresh stylesheet can never disagree. */
/* Shared header: the simulator's tools sit between the site links and the
   language menu, and drop to a second row when the bar gets narrow. */
header.top.pp-header {
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 12px; row-gap: 0; height: auto;
  width: auto; margin: 12px 12px 12px;
  padding: 0 8px 0 var(--pp-pad);
}
/* The floating bar is light glass, so its tools use dark ink */
:root:has(header.top.pp-header) { --head: 82px; } /* 12px gap + 58px bar + 12px gap */
header.top.pp-header .toggle { color: #3a4660; }
header.top.pp-header .btn { color: #0f1a33; background: #fff; border-color: #0f1a3329; border-radius: 999px; }
header.top.pp-header .btn:hover:not(:disabled) { background: #f1f4f9; }
header.top.pp-header .btn.primary { color: #fff; background: #d62839; border-color: #d62839; }
header.top.pp-header .btn.primary:hover:not(:disabled) { background: #b81f2f; }
header.top.pp-header .plane-name { color: #0f1a33; background: #fff; border-color: #0f1a3324; border-radius: 999px; padding: 7px 14px; }
header.top.pp-header .plane-name::placeholder { color: #0f1a3366; }
header.top.pp-header .plane-name:hover { border-color: #0f1a3340; }
header.top.pp-header .plane-name:focus-visible { outline: 2px solid #2f6bff; }
header.top.pp-header .brand { order: 1; }
header.top.pp-header .site-nav { order: 2; margin-inline-start: 6px; } /* 12px gap + 6 = the 18px the other pages use */
header.top.pp-header .plane-name { order: 3; flex: 1 1 200px; min-width: 0; max-width: 420px; }
header.top.pp-header .top-actions { order: 4; margin: 0; margin-inline-start: auto; }
header.top.pp-header .lang-slot { order: 5; height: 55px; align-items: center; }
header.top.pp-header .pp-lang { margin: 0; }
@media (width < 1200px) {
  :root:has(header.top.pp-header) { --head: 134px; } /* 12px gap + two rows, divider and borders (110px) + 12px gap */
  header.top.pp-header { border-radius: 26px; }
  header.top.pp-header .lang-slot { order: 3; margin-inline-start: auto; }
  header.top.pp-header::before {
    content: ""; order: 4; flex: 0 0 calc(100% + 2 * var(--pp-pad));
    height: 1px; margin-inline: calc(-1 * var(--pp-pad)) -8px; background: #0f1a3314;
  }
  header.top.pp-header .plane-name { order: 5; flex: 1 1 0; max-width: none; }
  header.top.pp-header .top-actions { order: 6; height: 52px; margin-inline-start: 0; }
}
@media (width <= 600px) {
  header.top.pp-header { position: sticky; column-gap: 8px; margin: 8px 8px 10px; border-radius: 24px; }
  header.top.pp-header .top-actions { height: 50px; gap: 6px; }
  header.top.pp-header .site-nav { margin-inline-start: -2px; } /* 8px gap - 2 = the 6px used on phones elsewhere */
  header.top.pp-header .plane-name { min-height: 36px; }
}
@media (height <= 500px) {
  header.top.pp-header { position: static; }
}
