/* PORTAL SHELL: the menu, the motion switch, the Didymo button and the readability panels (portal only; loaded
   after ptr-core.css and portal.html's own block). Values are ported from ptr-website-html public/TopNav.dc.html
   (production): the #ptrMenuOverlay rules, the .ptrMotionBtn rules and the #ptrTopNavTwin button. */

.pmSrOnly { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- the bar's two new buttons */
/* DIDYMO (Talk to Us). On the main site this button opens the twin widget; the widget does not accept the portal's
   origin, so here it is a link to the Didymo chat page on peopletechrevolution.com, same mark, same place. */
#ptrTopNavBar .ptrTwin {
  width: 44px; height: 44px; border-radius: 50%; flex: none; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.12);
  background: radial-gradient(130% 100% at 28% 18%, rgba(128,237,239,0.16), transparent 55%),
              radial-gradient(140% 110% at 78% 88%, rgba(109,87,255,0.26), transparent 62%), rgba(8,9,14,0.72);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -8px 18px rgba(109,87,255,0.14), 0 0 24px rgba(65,187,245,0.12);
  display: flex; align-items: center; justify-content: center; padding: 0; text-decoration: none;
}
#ptrTopNavBar .ptrTwin img { width: 24px; height: 24px; display: block; }
/* TopNav's <=520px size (portal.html sets it too, but this sheet loads later). */
@media (max-width: 520px) { #ptrTopNavBar .ptrTwin { width: 40px; height: 40px; } }
@media (hover: hover) { #ptrTopNavBar .ptrTwin:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), 0 0 30px rgba(109,87,255,0.4); } }

/* THE MOTION SWITCH. Hidden until portal-motion.js runs (html.ptr-motion-ready). Icon and words name the action.
   As on the main site (TopNav.dc.html): in the bar from 768px (icon and words from 1000px, icon only below), and on
   phones at the top of the menu beside Close. */
.ptrMotionBtn { display: none; }
html.ptr-motion-ready .ptrMotionBtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  min-width: 44px; height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer;
  font: 600 13px/1 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: 0.04em; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); color: #fff;
}
.ptrMotionBtn svg { display: block; width: 14px; height: 14px; flex: none; }
.ptrMotionBtn .pmtPlay, .ptrMotionBtn .pmtTxtPlay { display: none; }
html.ptr-motion-paused .ptrMotionBtn .pmtPause, html.ptr-motion-paused .ptrMotionBtn .pmtTxtPause { display: none; }
html.ptr-motion-paused .ptrMotionBtn .pmtPlay { display: block; }
html.ptr-motion-paused .ptrMotionBtn .pmtTxtPlay { display: inline; }
.ptrMotionBtn:focus-visible { outline: 3px solid #6D57FF; outline-offset: 3px; }
@media (max-width: 999.98px) {
  #ptrTopNavBar .ptrMotionBtn { width: 44px; padding: 0; }
  #ptrTopNavBar .ptrMotionBtn .pmtLabel { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (max-width: 767.98px) { html.ptr-motion-ready #ptrTopNavBar .ptrMotionBtn { display: none; } }
@media (min-width: 768px) { html.ptr-motion-ready #ptrMenuOverlay .ptrMotionBtn { display: none; } }
#ptrMenuOverlay .ptrMotionBtn:focus-visible { outline-color: #80EDEF; }
@media (max-width: 520px) { #ptrTopNavBar .ptrMotionBtn { width: 40px; min-width: 40px; height: 40px; } }
@media (forced-colors: active) { .ptrMotionBtn { border: 1px solid ButtonText !important; } }

/* PAUSED: the light volumes and streaks hold still (backdrop.js stops the shader itself). */
html.ptr-motion-paused .ptr-field, html.ptr-motion-paused .ptr-field * { animation-play-state: paused !important; }

/* With the menu open the page behind it does not scroll. */
html.pm-open, html.pm-open body { overflow: hidden; }

/* ---------------------------------------------------------------- the menu */
#ptrMenuOverlay {
  position: fixed; inset: 0; z-index: 890; display: flex; flex-direction: column;
  background: rgba(6,6,9,0.9); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  color: #fff; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
#ptrMenuOverlay[hidden] { display: none; }
#ptrMenuOverlay .pmHead { display: flex; justify-content: flex-end; padding: 14px clamp(20px, 4vw, 56px); }
#ptrMenuOverlay .ptrMotionBtn { margin-right: auto; border-color: rgba(255,255,255,0.2); background: transparent; }
#ptrMenuOverlay .pmClose {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.2); background: transparent;
  color: #fff; cursor: pointer; font-size: 18px;
}
/* The rows, their colours, their hover and the chevron discs are the main site's: each item carries its own inline
   style from TopNav.dc.html (portal-menu-data.js) and the hover rules are TopNav's own (portal-nav.css), both
   generated by tools/sync-portal-menu.mjs. What stays here is the container (TopNav's inline nav style, as a rule)
   and two portal rules. Row heights, discs and dividers are the main site's own, at every width (Kim 2026-10-17). */
.ptrMenuNav {
  flex: 1; display: flex; flex-direction: column; justify-content: safe center; gap: clamp(7px, 1.5vh, 15px);
  padding: 0 clamp(24px, 8vw, 120px); overflow-y: auto;
}
.ptrMenuNav a { text-decoration: none; }
/* A closed group stays closed: [hidden] wins over the main site's display:flex on .ptrMenuKids. */
.ptrMenuKids[hidden] { display: none; }

/* ---------------------------------------------------------------- readability over the moving field */
/* TEXT OVER THE SHADER SITS ON AN OPAQUE DARK PANEL (Kim 2026-10-13, mock D; WCAG 2.2 1.4.3). The field can paint
   any brand colour at up to full brightness under the text, so a text shadow cannot guarantee 4.5:1. Worst case
   arithmetic, field pure white under the panel: panel rgba(5,5,7,.68) leaves the surface at about 0.33 (sRGB),
   relative luminance about 0.09; the faintest portal text, white at 0.8 alpha, composites to about 0.87 (luminance
   about 0.73): (0.73 + 0.05) / (0.09 + 0.05) = 5.6:1. The panel is a background layer only (a pseudo-element
   outside the text box): no text moves or narrows. */
.portal-intro, .portal-main { position: relative; isolation: isolate; }
.portal-intro::before, .portal-main::before {
  content: ""; position: absolute; z-index: -1; inset: -16px -20px; border-radius: 16px;
  background: rgba(5,5,7,0.68); pointer-events: none;
}
.portal-main:not(:has(> section:not([hidden])))::before { display: none; }
@media (max-width: 520px) {
  .portal-intro::before, .portal-main::before { inset: -12px -10px; }
}

/* THE BAR'S ROOM. The motion switch takes 54px of the bar from 768px: below 900px the product name beside the
   emblem gives way (as it already does below 768px) so it never runs under TRAINING. */
@media (max-width: 899.98px) { #ptrTopNavBar .ptrBrand span { display: none; } }
/* Phones: the bar carries the four links, Didymo and Menu with TopNav's own phone rules (portal.html), as on the main
   site, where Pause motion is in the menu. Measured on peopletechrevolution.com: that row fits from 320px (no
   overflow, no overlap), so the portal keeps no narrower exceptions of its own. */

/* ---------------------------------------------------------------- the contact dialog */
/* THE MAIN SITE'S CONTACT FORM, ON THE PORTAL (Kim 2026-10-17; portal-contact.js). Every value below is the inline
   style of ptr-website-html public/Contact.dc.html's overlay, moved onto classes; the field, button and ring hover
   come from portal-nav.css (.pm-field, .pm-btn, generated from ptr-motion.css). */
html.ct-open, html.ct-open body { overflow: hidden; }
@keyframes ctFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ctRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
#ctOverlay {
  position: fixed; inset: 0; z-index: 950; background: #060609; color: #fff; overflow-y: auto; overscroll-behavior: contain;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; animation: ctFade 0.35s ease;
}
#ctOverlay[hidden], #ctOverlay [hidden] { display: none !important; }
#ctOverlay .ctGlow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 20% 10%, rgba(65,187,245,0.08), transparent 70%), radial-gradient(45% 40% at 85% 90%, rgba(165,103,241,0.08), transparent 70%);
}
#ctOverlay .ctTop { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 18px clamp(20px, 4vw, 56px); }
#ctOverlay .ctClose {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.24); background: rgba(6,6,9,0.6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; cursor: pointer; font-size: 20px; font-family: inherit;
}
#ctOverlay .ctClose:hover, #ctOverlay .ctAgain:hover { border-color: rgba(128,237,239,0.6); box-shadow: 0 0 24px rgba(65,187,245,0.25); }
#ctOverlay .ctBody {
  position: relative; max-width: 880px; margin: 0 auto; padding: clamp(10px, 4vh, 40px) clamp(20px, 4vw, 56px) clamp(80px, 10vh, 120px);
  display: flex; flex-direction: column; gap: clamp(28px, 5vh, 48px); animation: ctRise 0.5s ease;
}
#ctOverlay .ctTitle { margin: 0; font-size: clamp(40px, 6.4vw, 84px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-wrap: pretty; }
#ctOverlay .ctReq { margin: 0; font-size: 15px; line-height: 1.4; color: inherit; }
#ctOverlay .ctForm { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 22px 26px; }
#ctOverlay .ctField { display: flex; flex-direction: column; gap: 8px; }
#ctOverlay .ctWide { grid-column: 1 / -1; }
#ctOverlay .ctLabel { font-size: 12px; letter-spacing: 0.18em; color: rgba(255,255,255,0.55); }
#ctOverlay .ctInput {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; color: #fff; font-size: 16px;
  padding: 0 16px; height: 52px; font-family: inherit; outline: none; box-sizing: border-box; width: 100%;
}
#ctOverlay .ctSelect { padding: 0 14px; }
#ctOverlay .ctSelect option { background: #0B0D12; color: #fff; }
#ctOverlay .ctSelect option[value=""] { color: rgba(255,255,255,0.6); }
#ctOverlay .ctArea { height: auto; padding: 14px 16px; resize: vertical; }
#ctOverlay .ctInput:focus { border-color: rgba(128,237,239,0.7); box-shadow: 0 0 0 3px rgba(65,187,245,0.15); }
#ctOverlay .ctHp { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
#ctOverlay .ctError {
  grid-column: 1 / -1; border: 1px solid rgba(255,138,128,0.45); background: rgba(255,138,128,0.09); border-radius: 14px;
  padding: 14px 16px; font-size: 15px; line-height: 1.5; color: rgba(255,220,215,0.95);
}
#ctOverlay .ctFoot { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 6px; }
#ctOverlay .ctSubmit {
  height: 56px; padding: 0 40px; border-radius: 28px; border: 1px solid rgba(255,255,255,0.14);
  background: radial-gradient(130% 100% at 28% 18%, rgba(128,237,239,0.2), transparent 55%), radial-gradient(140% 110% at 78% 88%, rgba(109,87,255,0.3), transparent 62%), rgba(10,11,18,0.7);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -10px 26px rgba(109,87,255,0.16), 0 10px 34px rgba(4,4,8,0.5), 0 0 32px rgba(65,187,245,0.14);
  color: #fff; font-size: 14px; letter-spacing: 0.14em; font-weight: 600; font-family: inherit; transition: box-shadow 0.35s, transform 0.35s; cursor: pointer;
}
#ctOverlay .ctSubmit:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -12px 30px rgba(128,237,239,0.22), 0 14px 42px rgba(4,4,8,0.55), 0 0 50px rgba(109,87,255,0.36);
}
#ctOverlay .ctSubmit.ctBusy { cursor: progress; opacity: 0.6; }
#ctOverlay .ctPrivacy { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.55); max-width: 460px; }
#ctOverlay .ctPrivacy a { color: inherit; text-decoration: underline; }
#ctOverlay .ctSent {
  position: relative; min-height: 70svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center; padding: 0 24px; animation: ctRise 0.5s ease;
}
#ctOverlay .ctThanks { margin: 0; font-size: clamp(36px, 6vw, 76px); font-weight: 700; letter-spacing: -0.03em; outline: none; }
#ctOverlay .ctSentText { font-size: clamp(16px, 2vw, 20px); color: rgba(255,255,255,0.7); max-width: 520px; line-height: 1.5; }
#ctOverlay .ctAgain {
  margin-top: 10px; height: 48px; padding: 0 28px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.28); background: transparent;
  color: #fff; font-size: 14px; letter-spacing: 0.1em; cursor: pointer; font-family: inherit;
}
@media (prefers-reduced-motion: reduce) { #ctOverlay, #ctOverlay .ctBody, #ctOverlay .ctSent { animation: none; } }
