/* Polygate Health site styles. Page layout is inline in each page template; shared rules and animations live here. */
/* Smooth scrolling is switched on by js/runtime.js after the page has loaded (so a link such as /#join lands at once), and never for visitors who asked for reduced motion (B-024). */
@media (prefers-reduced-motion:no-preference){html.pg-smooth{scroll-behavior:smooth}}
body{margin:0}
a{color:#111411}a:hover{color:#0B6B3A}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #0B6B3A;outline-offset:3px}
/* Controls inside a rounded, overflow:hidden group get an inset two-tone ring so the group cannot clip it (B-014). */
.pg-seg button:focus-visible{outline-offset:-3px;box-shadow:inset 0 0 0 6px #FFFFFF}
/* Skip link: hidden until a keyboard user reaches it (B-019). */
.pg-skip{position:absolute;left:12px;top:-80px;z-index:100;padding:12px 18px;border-radius:8px;background:#111411;color:#FFFFFF;font:600 15px Inter,system-ui,sans-serif;text-decoration:none}
.pg-skip:focus{top:12px}.pg-skip:hover{color:#FFFFFF}
/* Demo table header cells keep the look they had as <td> (B-020). */
#demo th{font-weight:500;text-align:left}
/* The green ring is only 2.8:1 on the dark Clinician oversight section; use the bright accent there (B-021). */
#security a:focus-visible,#security button:focus-visible{outline-color:#2FBF71}
.pc-dd{position:relative}.pc-menu{display:none;position:absolute;top:100%;left:0;min-width:270px;background:#FFFFFF;border:1px solid #111411;border-radius:12px;box-shadow:6px 6px 0 #111411;padding:8px;z-index:30}.pc-dd:hover .pc-menu,.pc-dd:focus-within .pc-menu{display:block}.pc-menu a{display:flex;flex-direction:column;gap:1px;padding:10px 12px;border-radius:8px;text-decoration:none;color:#111411;font-size:15px;font-weight:600}.pc-menu a span{font-weight:400;font-size:13px;color:#5B635D}.pc-menu a:hover{background:#E6F2EA}
.pc-scene{position:absolute;inset:0;opacity:0;animation:pcScene 10s infinite}.pc-s2{animation-delay:5s}
/* A scene rises into place instead of scaling up, so text in it is never drawn below its set size (the hero captions stay at 12px or more). */
@keyframes pcScene{0%{opacity:0;transform:translateY(8px)}6%{opacity:1;transform:none}44%{opacity:1;transform:none}50%{opacity:0}100%{opacity:0}}
@keyframes pcOrbit{to{transform:rotate(360deg)}}@keyframes pcCounter{to{transform:rotate(-360deg)}}@keyframes pcSpin{to{transform:rotate(360deg)}}
@keyframes pcCard{0%{opacity:0;transform:translateY(16px)}3%{opacity:1;transform:none}100%{opacity:1;transform:none}}
@keyframes pcMarq{to{transform:translateX(-50%)}}@keyframes pcPlay{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.pc-orb{animation:pcOrbit 24s linear infinite}.pc-cnt{animation:pcCounter 24s linear infinite}.pc-spin{animation:pcSpin .9s linear infinite}
.pc-card{opacity:0;animation:pcCard 10s infinite}.pc-marq{display:flex;width:max-content;animation:pcMarq 40s linear infinite}.pc-play{transform-origin:left;animation:pcPlay 90s linear forwards}
.pc-col{transition:flex-grow .35s ease}
.pc-link{stroke-dasharray:1;stroke-dashoffset:0;animation:pcLink 10s infinite}
@keyframes pcLink{0%,18%{stroke-dashoffset:1}32%,100%{stroke-dashoffset:0}}
.pc-rd{animation:pcRd 10s infinite}@keyframes pcRd{0%,28%{opacity:0}36%,100%{opacity:1}}
.pc-pulse{transform-box:fill-box;transform-origin:center;animation:pcPulse 10s infinite}@keyframes pcPulse{0%,30%{opacity:0;transform:scale(.8)}38%{opacity:.8}55%,100%{opacity:0;transform:scale(1.4)}}
.pc-spinp{transform-box:fill-box;transform-origin:center;animation:pcSpin 20s linear infinite}
.pg-ph{background:linear-gradient(135deg,#CFE6D6,#8FC4A5)}
@media (prefers-reduced-motion:reduce){.pg-fly,.pg-chip,.pg-ring,.pc-link,.pc-rd,.pc-pulse,.pc-spinp{animation:none!important}.pc-pulse{opacity:0}}

@media (prefers-reduced-motion:reduce){.pc-scene,.pc-orb,.pc-cnt,.pc-spin,.pc-card,.pc-marq,.pc-play{animation:none!important}.pc-s1{opacity:1}.pc-card{opacity:1}}
.pcreel{position:relative;width:100%;height:100%;overflow:hidden;color:#FFFFFF}.pcr{position:absolute;inset:0;padding:0 8% 28px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;opacity:0;animation:pcr 20s infinite;animation-play-state:var(--pcs,running)}.pcbar{position:absolute;left:0;bottom:0;height:4px;width:100%;background:#2FBF71;transform-origin:left;animation:pcb 20s linear infinite;animation-play-state:var(--pcs,running)}@keyframes pcr{0%,17%{opacity:1}20%,100%{opacity:0}}@keyframes pcb{from{transform:scaleX(0)}to{transform:scaleX(1)}}@media (prefers-reduced-motion:reduce){.pcr{animation:none}.pcr:first-child{opacity:1}.pcbar{animation:none}}

/* Hero picture (home page). Six realistic icons in large white round chips, each with a real HTML caption under it, around the Polygate tile.
   Everything is placed from the centre of the picture in whole pixels (--lx/--ly on large screens, --sx/--sy on phones), never scaled, so the 12px
   captions are always drawn at 12px. Large: the chips sit on a circle. Phones (440px and under): an upright oval and smaller sizes, so the two-line
   captions fit between the chips and the tile. Every loop here stops under "Pause motion" (the .pg-paused rule below) and under reduced motion. */
.pg-hero{position:relative;height:470px;border:1px solid #111411;border-radius:14px;overflow:hidden;box-shadow:8px 8px 0 #111411;background:radial-gradient(circle at 50% 35%,#1C7A4A,#0B3D24 75%);--chip:80px;--icon:60px;--tile:96px;--cy:198px;--k:1}
.pg-stage{position:absolute;inset:0 0 44px 0}
.pg-origin{position:absolute;left:50%;top:var(--cy);width:0;height:0}
.pg-links{position:absolute;left:-170px;top:-170px;width:340px;height:340px;overflow:visible}
.pg-sm{display:none}
.pg-ring{transform-box:fill-box;transform-origin:center;animation:pcSpin 60s linear infinite}
.pg-tile{position:absolute;left:calc(var(--tile) * -.5469);top:calc(var(--tile) * -.5469);width:calc(var(--tile) * 1.0938);height:calc(var(--tile) * 1.0938)}
.pg-hero .pg-slot{position:absolute;left:var(--lx);top:var(--ly);width:0;height:0}
.pg-fly{position:absolute;left:0;top:0;width:0;height:0;animation:pgFly 10s infinite ease-in-out}
.pg-item{position:absolute;left:0;top:calc(var(--chip) * -.5);display:flex;flex-direction:column;align-items:center;gap:6px;transform:translateX(-50%)}
.pg-chip{display:flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:var(--chip);height:var(--chip);border-radius:50%;background:radial-gradient(circle at 34% 24%,#FFFFFF,#F6F9F6 52%,#E3EAE5);border:1px solid rgba(17,20,17,.18);box-shadow:0 12px 22px -8px rgba(0,0,0,.55),0 0 0 5px rgba(255,255,255,.13);animation:pgFloat var(--ft) ease-in-out var(--fd) infinite alternate}
.pg-chip img{display:block;width:var(--icon);height:var(--icon)}
.pg-lbl{display:block;box-sizing:border-box;padding:3px 9px 4px;border:1px solid rgba(255,255,255,.22);border-radius:14px;background:rgba(7,36,21,.74);color:#F4FAF6;font:500 12px/1.35 'IBM Plex Mono',monospace;text-align:center;white-space:nowrap}
.pg-lbl br{display:none}
.pg-cap{position:absolute;left:0;right:0;bottom:22px;text-align:center;font-family:'IBM Plex Mono',monospace;font-size:12px;letter-spacing:.08em;color:#CFE6D6}
.pg-ico{flex:none;display:block;width:40px;height:40px}
@keyframes pgFly{0%,6%{transform:translate(calc(var(--dx) * var(--k) * 1px),calc(var(--dy) * var(--k) * 1px)) rotate(var(--fr))}22%,100%{transform:none}}
@keyframes pgFloat{from{transform:translate(0,0) rotate(-1.4deg)}to{transform:translate(0,-4px) rotate(1.4deg)}}
@media (max-width:440px){
.pg-hero{height:440px;--chip:56px;--icon:42px;--tile:68px;--cy:184px;--k:.6}
.pg-lg{display:none}.pg-sm{display:inline}
.pg-sm .pg-ring{animation:none}
.pg-hero .pg-slot{left:var(--sx);top:var(--sy)}
.pg-lbl br{display:inline}
.pg-cards{width:calc(100% - 24px) !important}
.pg-hero .pg-card{width:100% !important;margin-left:0 !important}
}

/* Phone header and Menu (B-030). Above 640px the header is the desktop header and the Menu button and its panel are not shown.
   At 640px and under it is one compact row (logo, Early access, Menu) of 64px at most, and the navigation lives in the Menu panel.
   The header's layout is written inline in each page, so the phone rules below use !important to override it. */
.pg-menu-btn,.pg-menu{display:none}
.pg-menu-btn{align-items:center;min-height:44px;padding:0 12px;border:1px solid #111411;border-radius:8px;background:#FFFFFF;color:#111411;font:600 14px Inter,system-ui,sans-serif;cursor:pointer}
.pg-menu-btn:hover{background:#E6F2EA}
.pg-menu-btn[aria-expanded=true]{background:#111411;color:#FFFFFF}
.pg-menu{border-top:1px solid #DDE1DB;background:#FFFFFF}
.pg-menu ul{margin:0;padding:0;list-style:none}
.pg-menu>ul{padding:4px 16px 16px}
.pg-menu a{display:flex;align-items:center;min-height:44px;padding:0 6px;border-radius:6px;color:#111411;font-size:16px;font-weight:600;text-decoration:none}
.pg-menu ul ul{margin:0 0 6px 6px;padding-left:12px;border-left:2px solid #DDE1DB}
.pg-menu ul ul a{min-height:40px;font-size:15px;font-weight:400;color:#3F4741}
.pg-menu a:hover{background:#E6F2EA;color:#0B6B3A}
@media (max-width:640px){
.pg-hdr{flex-wrap:nowrap !important;gap:6px !important;padding:8px 16px !important}   /* nowrap on purpose: with wrap, 320-360px phones get a two-row header (check C4). Known cost: user text-spacing overrides (WCAG 1.4.12) can push the Menu button a few px past 320 */
.pg-logo{flex:0 1 auto !important}
.pg-wordmark{font-size:17px !important;line-height:1.05}
.pg-nav{display:none !important}
.pg-hdr-actions{flex:none;flex-wrap:nowrap !important;gap:6px !important}
.pg-early{padding:0 12px !important}
.pg-menu-btn{display:inline-flex}
.pg-menu:not([hidden]){display:block}
}
@media (max-width:360px){
.pg-hdr,.pg-hdr-actions{gap:4px !important}
.pg-wordmark{font-size:16px !important}
.pg-early,.pg-menu-btn{padding:0 10px !important}
}

/* Demo table on phones (B-030). At 640px and under each case becomes a stacked card: Case, Procedure and Status on top, then Interval
   and Next as labelled lines. The table keeps its real semantics (explicit roles in the page). The header row stays for assistive
   technology but is hidden from view, and the columns that do not fit (#, POD, Path due) are dropped from the headers and from every
   row alike, so each cell still lines up with its header. The cells' layout is written inline in the page, so these rules use
   !important to override it. */
@media (max-width:640px){
.pg-tblwrap{overflow-x:visible !important}
.pg-tbl{display:block !important;width:auto !important;min-width:0 !important}
.pg-tbl tbody{display:grid !important;gap:10px;padding:12px}
.pg-tbl tr{display:grid !important;grid-template-columns:auto minmax(0,1fr) auto;align-items:baseline;gap:6px 10px;padding:12px;border:1px solid #DDE1DB;border-radius:8px;background:#FFFFFF !important;color:#111411 !important;font-weight:400 !important}
.pg-tbl tr.pg-tot{background:#F6F8F5 !important}
.pg-tbl tr.pg-head{display:block !important;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pg-tbl th,.pg-tbl td{display:block;min-width:0;padding:0 !important;border:0 !important;text-align:left !important;overflow-wrap:anywhere}
.pg-tbl td:not(:nth-child(7)){background:transparent !important;box-shadow:none !important}
.pg-tbl th:nth-child(1),.pg-tbl th:nth-child(4),.pg-tbl th:nth-child(5),.pg-tbl td:nth-child(1),.pg-tbl td:nth-child(4),.pg-tbl td:nth-child(5){display:none}
.pg-tbl td:nth-child(2){grid-column:1;grid-row:1;font-weight:600;color:#111411 !important}
.pg-tbl td:nth-child(3){grid-column:2;grid-row:1}
.pg-tbl td:nth-child(6){grid-column:3;grid-row:1;justify-self:end;padding:1px 8px !important;border:1px solid #111411 !important;border-radius:999px;white-space:nowrap}
.pg-tbl td:nth-child(7),.pg-tbl td:nth-child(8){grid-column:1 / -1}
.pg-tbl td:nth-child(7){grid-row:2;justify-self:start;margin:-3px 0 -3px -8px;padding:3px 8px !important;border-radius:6px}
.pg-tbl td:nth-child(8){grid-row:3}
.pg-tbl td:nth-child(7)::before,.pg-tbl td:nth-child(8)::before{content:attr(data-label);content:attr(data-label) / "";display:inline-block;min-width:76px;margin-right:8px;color:#5B635D;font:500 12px 'IBM Plex Mono',monospace;letter-spacing:.08em;text-transform:uppercase}   /* the second form hides the visual label from screen readers, which already hear the column header; browsers without it keep the first */
.pg-tbl tr.pg-tot td:nth-child(3){grid-column:1 / 3}
}

/* Tab panels (B-031) are in the tab sequence, because their first content is not a control. They get the site's ring, drawn inside the
   panel so that no overflow:hidden parent can clip it. */
[role=tabpanel]:focus-visible{outline:3px solid #0B6B3A;outline-offset:-3px}

/* Pause motion (B-031, WCAG 2.2.2). The button sits just above the hero picture. While motion is paused, every animation on the page is
   paused (the page root gets pg-paused). Visitors who ask for reduced motion already get no loops (the rules above), so they never see the button. */
.pg-motion{position:absolute;right:0;bottom:calc(100% + 6px);z-index:2;display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border:1px solid #111411;border-radius:8px;background:#FFFFFF;color:#111411;font:600 14px Inter,system-ui,sans-serif;cursor:pointer;box-shadow:3px 3px 0 #111411}
.pg-motion:hover{background:#E6F2EA}
.pg-paused .pg-motion{background:#111411;color:#FFFFFF}
.pg-paused .pg-motion:hover{background:#2F3A33}
.pg-paused *,.pg-paused *::before,.pg-paused *::after{animation-play-state:paused !important}
@media (prefers-reduced-motion:reduce){.pg-motion{display:none}}

/* "Request demo" (B-032). In the header it is the secondary button next to "Early access"; phones get the same link in the Menu panel
   instead, so the phone header stays one row (B-030). */
.pg-demo{white-space:nowrap;display:inline-flex;align-items:center;box-sizing:border-box;min-height:44px;padding:0 18px;border:1px solid #111411;border-radius:8px;background:#FFFFFF;color:#111411;font-size:15px;font-weight:600;text-decoration:none}   /* border-box: with its 1px border it stays 44px, the height of "Early access" beside it (F1) */
.pg-demo:hover{background:#E6F2EA;color:#0B6B3A}

/* The demo page keeps its details form in the page while it is hidden (so Back finds every answer as typed). The form's layout is inline,
   which would beat the browser's own [hidden] rule, so this one says it plainly. */
#demo-details[hidden]{display:none !important}
/* Times grouped by day, each time a radio button drawn as a tile. The real radio sits invisibly over its tile, so a click, Tab, the arrow
   keys and Space all work natively and a screen reader gets a normal radio group; the tile shows the state and the focus ring.
   The tiles are written as .pg-slots .pg-slot because the home hero uses the name .pg-slot too (for its chip positions, scoped there as .pg-hero .pg-slot). */
.pg-day{margin:0 0 8px;font:500 12px 'IBM Plex Mono',monospace;letter-spacing:.08em;text-transform:uppercase;color:#5B635D}
.pg-slots{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px}
.pg-slots .pg-slot{position:relative;display:block}
.pg-slots .pg-slot input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.pg-slots .pg-slot span{display:flex;align-items:center;justify-content:center;min-height:48px;padding:0 4px;border:1px solid #111411;border-radius:8px;background:#FFFFFF;color:#111411;font:500 14px Inter,system-ui,sans-serif;text-align:center}
.pg-slots .pg-slot input:hover+span{background:#E6F2EA}
.pg-slots .pg-slot input:checked+span,.pg-slots .pg-slot input:checked:hover+span{background:#111411;color:#FFFFFF}
.pg-slots .pg-slot input:focus-visible{outline:none}
.pg-slots .pg-slot input:focus-visible+span{outline:3px solid #0B6B3A;outline-offset:3px}
@media (max-width:640px){
.pg-demo{display:none !important}
.pg-main{padding:32px 16px 64px !important;gap:40px !important}
.pg-main .pg-card{padding:20px !important}
}

/* About page. The hero is a full-bleed photo (set in about.html) under a dark shade (.pg-shade); its height lives here so phones get a shorter hero. */
.pg-about-hero{min-height:72vh}
@media (max-width:640px){.pg-about-hero{min-height:60vh}}
/* The steps row ("How the agents work") is numbered by CSS, so the numbers are decoration and never part of the page text; the grid in the page
   stacks the steps on phones. The emphasized step (pg-on, "Deploy") gets the active look of the home-page tabs: a near-black border and a green number. */
.pg-steps{counter-reset:pgstep}.pg-steps>li{counter-increment:pgstep}
.pg-step-no{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid #111411;border-radius:8px;background:#FFFFFF;font:500 12px 'IBM Plex Mono',monospace;color:#5B635D}
.pg-step-no::before{content:counter(pgstep,decimal-leading-zero)}
.pg-steps>li.pg-on .pg-step-no{color:#0B6B3A;border-color:#0B6B3A;box-shadow:2px 2px 0 #111411}
/* The green ring is only 2.8:1 on the dark CTA band; use the bright accent there, as on the Clinician oversight section (B-021). */
#about-cta a:focus-visible{outline-color:#2FBF71}
