/* ==========================================================================
   Poggy Scripts chrome: the store header and footer, and the homepage.
   --------------------------------------------------------------------------
   Loaded by includes/header.php on pages that wear the store chrome (the
   homepage and every store page). The colours come from css/store.css, which
   those pages load too; each var() carries a fallback so the header still
   reads correctly on the rare page that does not.
   ========================================================================== */

/* Header ------------------------------------------------------------------- */

/* Four entries: Scripts (submenu), Free, All Access, Help (submenu).
   Markup: includes/store-header.php. Behaviour: js/nav.js (it adds .pg-js to
   <html>; without it the submenus still open on hover and focus). Under 900px
   the nav is the Menu button's full-width panel, submenus as accordions. */

.pg-header {
  /* Room kept on the right for the fixed Discord + basket cluster
     (.st-utilities, css/store.css), which sits over this bar. */
  --pg-clear: 400px;
  position: sticky;
  top: 0;
  z-index: 1300;
  background: rgba(var(--pg-bg-rgb), 0.94);
  border-bottom: 1px solid var(--st-rule-strong);
  box-shadow: 0 8px 26px rgba(var(--pg-shade-rgb), 0.35);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
}
/* Pages without the cluster (tickets, appeals, legal, 404) use the whole bar. */
body:not(:has(.st-utilities)) .pg-header { --pg-clear: 24px; }

.pg-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 var(--pg-clear) 0 24px;
}

.pg-brand {
  display: flex;
  flex-direction: column;
  flex: none;
  text-decoration: none;
  line-height: 1.05;
}
.pg-brand__name {
  font-family: var(--pg-font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--st-ink);
}
.pg-brand__by {
  font-family: var(--pg-font-body);
  font-size: 0.74rem;
  color: var(--st-ink-faint);
  margin-top: 3px;
}
.pg-brand:hover .pg-brand__name { color: var(--st-tan); }

/* The Menu button: phones and tablets only. */
.pg-menubtn { display: none; }

.pg-nav { min-width: 0; }
.pg-nav ul { list-style: none; margin: 0; padding: 0; }
.pg-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pg-nav__item { position: relative; }

/* A top-level entry: a link (Free, All Access) or a disclosure button
   (Scripts, Help). Both look the same. */
.pg-nav__top {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 44px;
  margin: 0;
  padding: 0.7em 0.9em;
  font-family: var(--pg-font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--st-ink-soft);
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
a.pg-nav__top:visited { color: var(--st-ink-soft); }
.pg-nav__top:hover,
.pg-nav__top:focus-visible,
.pg-nav__item.is-open > .pg-nav__top { color: var(--pg-accent); background: var(--pg-accent-faint); }
.pg-nav__top[aria-current="page"],
.pg-nav__item.is-current > .pg-nav__top { color: var(--st-ink); border-bottom-color: var(--pg-accent); }
.pg-nav__chev { width: 11px; height: 11px; flex: none; transition: transform .2s ease; }
.pg-nav__item.is-open > .pg-nav__top .pg-nav__chev { transform: rotate(180deg); }

/* All Access: the one gold entry, framed so it reads as the offer. */
.pg-nav__top--aa,
a.pg-nav__top--aa:visited {
  color: var(--pg-accent2);
  border: 1px solid var(--pg-accent2-soft);
  background: var(--pg-accent2-faint);
  margin-left: 4px;
}
.pg-nav__top--aa:hover,
.pg-nav__top--aa:focus-visible { color: var(--pg-accent2-hi); background: rgba(var(--pg-accent2-rgb), 0.18); border-color: var(--pg-accent2); }
.pg-nav__top--aa:focus-visible { outline-color: var(--pg-accent2); }
.pg-nav__top--aa[aria-current="page"] { color: var(--pg-accent2-hi); border-color: var(--pg-accent2); border-bottom-color: var(--pg-accent2); }

/* The submenu panel: square, 0.94 midnight, a thin light edge. */
.pg-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px 36px;
  padding: 20px 24px 18px;
  background: rgba(var(--pg-bg-rgb), 0.94);
  border: 1px solid var(--pg-border-strong);
  border-top: 2px solid var(--pg-accent);
  box-shadow: var(--pg-shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
/* Bridge the gap between the button and the panel so hover does not drop. */
.pg-sub::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.pg-nav__item.is-open > .pg-sub,
html:not(.pg-js) .pg-nav__item--sub:hover > .pg-sub,
html:not(.pg-js) .pg-nav__item--sub:focus-within > .pg-sub {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .16s ease, transform .16s ease, visibility 0s;
}
.pg-sub--help { left: auto; right: 0; }
.pg-sub__group { min-width: 150px; }
.pg-sub__head {
  margin: 0 0 8px;
  font-family: var(--pg-font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pg-accent2);
  line-height: 1.4;
}
.pg-sub__link {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin: 0 -10px;
  padding: 0.35em 10px;
  font-family: var(--pg-font-body);
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--st-ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.pg-sub__link:visited { color: var(--st-ink-soft); }
.pg-sub__link:hover,
.pg-sub__link:focus-visible { color: var(--pg-accent); background: var(--pg-accent-faint); border-left-color: var(--pg-accent-soft); }
.pg-sub__link:focus-visible { outline-offset: -2px; }
.pg-sub__link[aria-current="page"] { color: var(--st-ink); border-left-color: var(--pg-accent); background: var(--pg-accent-faint); }
.pg-sub__link--aa, .pg-sub__link--aa:visited { color: var(--pg-accent2); }
.pg-sub__link--aa:hover, .pg-sub__link--aa:focus-visible { color: var(--pg-accent2-hi); background: var(--pg-accent2-faint); border-left-color: var(--pg-accent2-soft); }
.pg-sub__ext { color: var(--st-ink-faint); margin-left: 0.3em; font-size: 0.85em; }

/* Line the fixed cluster up with the bar. */
body.has-pg-header .st-utilities { top: 10px; }
/* The cluster now lives in the bar, so the page no longer steps round it. */
body.has-pg-header .st-crumbs { padding-right: 0; }
body.has-pg-header .st-masthead { --st-masthead-pad: 30px; }

@media (max-width: 1320px) {
  .pg-brand__by { display: none; }
}

/* Phones and tablets: the Menu button and a full-width panel. ------------- */
@media (max-width: 1000px) {
  .pg-header { --pg-clear: 400px; }
  body:not(:has(.st-utilities)) .pg-header { --pg-clear: 16px; }
  .pg-header__inner { gap: 10px; min-height: 60px; padding: 8px var(--pg-clear) 8px 16px; }
  body.has-pg-header .st-utilities { top: 8px; }
  body.has-pg-header :is(.st-return, .st-cartbtn) { min-height: 44px; }

  .pg-menubtn {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    min-height: 44px;
    min-width: 44px;
    margin: 0 0 0 auto;
    padding: 0 0.95em;
    font-family: var(--pg-font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--st-ink);
    background: rgba(var(--pg-raise-rgb), 0.94);
    border: 1px solid var(--pg-border-strong);
    border-radius: 0;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background-color .2s ease;
  }
  .pg-menubtn:hover,
  .pg-menubtn[aria-expanded="true"] { color: var(--pg-accent); border-color: var(--pg-accent); background: var(--pg-accent-faint); }
  .pg-menubtn__bars { position: relative; display: block; width: 18px; height: 12px; flex: none; }
  .pg-menubtn__bars span {
    position: absolute; left: 0; right: 0; height: 2px; background: currentColor;
    transition: transform .2s ease, opacity .2s ease, top .2s ease;
  }
  .pg-menubtn__bars span:nth-child(1) { top: 0; }
  .pg-menubtn__bars span:nth-child(2) { top: 5px; }
  .pg-menubtn__bars span:nth-child(3) { top: 10px; }
  .pg-menubtn[aria-expanded="true"] .pg-menubtn__bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
  .pg-menubtn[aria-expanded="true"] .pg-menubtn__bars span:nth-child(2) { opacity: 0; }
  .pg-menubtn[aria-expanded="true"] .pg-menubtn__bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

  /* The panel hangs from the bottom of the sticky bar and fills the screen. */
  .pg-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - var(--pg-header-h, 61px));
    height: calc(100dvh - var(--pg-header-h, 61px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 16px 40px;
    /* Solid: the bar's own backdrop blur cannot reach a panel inside it, so
       anything less would let the page's text show through the links. */
    background: var(--pg-bg);
    border-top: 1px solid var(--pg-border);
    box-shadow: 0 24px 40px rgba(var(--pg-shade-rgb), 0.5);
  }
  .pg-header.is-menu-open .pg-nav { display: block; }
  .pg-nav__list { flex-direction: column; align-items: stretch; gap: 0; max-width: 640px; margin: 0 auto; }
  .pg-nav__item { border-bottom: 1px solid var(--pg-border); }
  .pg-nav__top {
    display: flex;
    width: 100%;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 12px;
    font-size: 0.92rem;
    border-bottom: 0;
    border-left: 2px solid transparent;
  }
  .pg-nav__top[aria-current="page"],
  .pg-nav__item.is-current > .pg-nav__top { border-left-color: var(--pg-accent); border-bottom: 0; }
  .pg-nav__chev { width: 14px; height: 14px; }
  .pg-nav__top--aa { margin: 12px 0; border: 1px solid var(--pg-accent2-soft); }
  .pg-nav__item:has(> .pg-nav__top--aa) { border-bottom: 0; }

  /* Submenus become accordions. */
  .pg-sub {
    position: static;
    display: none;
    gap: 14px;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    padding: 6px 12px 18px;
    background: none;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .pg-sub::before { display: none; }
  .pg-nav__item.is-open > .pg-sub { display: grid; }
  .pg-sub__group ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
  .pg-sub__link { min-height: 44px; margin: 0; font-size: 1rem; white-space: normal; }

  /* No JavaScript: no Menu button, the links sit under the bar as a list. */
  html:not(.pg-js) .pg-menubtn { display: none; }
  html:not(.pg-js) .pg-header__inner { flex-wrap: wrap; }
  html:not(.pg-js) .pg-nav { display: block; position: static; height: auto; flex: 1 0 100%; padding: 0; background: none; box-shadow: none; }
  html:not(.pg-js) .pg-sub { display: grid; }

  /* While the menu is open the page behind stays put. */
  html.pg-menu-open, html.pg-menu-open body { overflow: hidden; }
}
@media (max-width: 780px) {
  .pg-header { --pg-clear: 290px; }
}
/* A phone: the Discord button keeps its logo and its glow, and its name
   moves to the screen reader so the Menu button fits beside the basket. */
@media (max-width: 430px) {
  .pg-header { --pg-clear: 142px; }
  .pg-logo { height: 34px; }
  body.has-pg-header .st-discord__short {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  body.has-pg-header .st-return { padding: 0 0.8em; }
}
@media (max-width: 374px) {
  .pg-menubtn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .pg-menubtn { padding: 0; justify-content: center; }
}

/* Footer ------------------------------------------------------------------- */

.pg-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--st-rule-strong);
  background: rgba(var(--pg-deep-rgb), 0.9);
  color: var(--st-ink-soft);
  font-family: var(--pg-font-body);
}
.pg-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 24px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.pg-footer__brand { font-family: var(--pg-font-display); font-size: 1.1rem; font-weight: 700; color: var(--st-ink); margin: 0 0 8px; }
.pg-footer p { margin: 0; line-height: 1.6; font-size: 0.95rem; }
.pg-footer h2 {
  font-family: var(--pg-font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pg-accent2);
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  text-align: left;
}
.pg-footer ul { list-style: none; margin: 0; padding: 0; }
.pg-footer li { margin: 0 0 7px; }
.pg-footer a { color: var(--st-ink-soft); text-decoration: none; }
.pg-footer a:hover { color: var(--st-tan); }
.pg-footer__legal {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 28px;
  border-top: 1px solid var(--st-rule);
  font-size: 0.85rem;
  color: var(--st-ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.pg-footer__legal a { color: var(--st-ink-faint); }
/* Partner band, between the link columns and the legal line. */
.pg-footer__partner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--st-rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.pg-footer__partner h2 { margin: 0; }
.pg-footer__partner a { display: inline-flex; align-items: center; gap: 10px; color: var(--st-ink); }
.pg-footer__partner img { width: 36px; height: 36px; border-radius: 50%; display: block; }
@media (max-width: 860px) { .pg-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A phone: the blurb across the top, the link lists two by two, and each
   link a full-height tap target. */
@media (max-width: 520px) {
  .pg-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; padding: 34px 16px 20px; }
  .pg-footer__inner > div:first-child { grid-column: 1 / -1; }
  .pg-footer li { margin: 0; }
  .pg-footer li a { display: flex; align-items: center; min-height: 40px; }
  .pg-footer__partner, .pg-footer__legal { padding-left: 16px; padding-right: 16px; }
  .pg-footer__partner h2 { flex: 1 0 100%; }
  .pg-footer__partner a, .pg-footer__legal a { min-height: 40px; display: inline-flex; align-items: center; }
  .pg-footer__legal { align-items: center; }
}

/* iOS zooms the page into any field under 16px: keep them at 16px on phones. */
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
  select,
  textarea { font-size: 16px !important; }
}

/* Homepage ----------------------------------------------------------------- */

.st.pg-home { padding-top: 10px; }

.pg-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 48px;
  align-items: center;
  padding: 44px 0 36px;
}
.pg-hero h1 {
  font-size: clamp(2.05rem, 4.1vw, 3.3rem);
  line-height: 1.08;
  margin: 0 0 18px;
}
.pg-hero__lede { font-size: 1.12rem; line-height: 1.65; color: var(--st-ink-soft); margin: 0 0 12px; max-width: 62ch; }
.pg-hero__lede strong { color: var(--st-ink); font-weight: 600; }
.pg-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 26px; }
.pg-hero__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none; margin: 0; padding: 0; max-width: 560px;
  border: 1px solid var(--st-rule); border-radius: var(--st-radius); background: var(--st-panel);
}
.pg-hero__stats li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px 12px; border-left: 1px solid var(--st-rule); }
.pg-hero__stats li:first-child { border-left: 0; }
.pg-hero__stats b { font-family: var(--pg-font-body); font-size: 1.55rem; color: var(--pg-accent2); line-height: 1.1; }
.pg-hero__stats span { font-size: 0.78rem; color: var(--st-ink-faint); margin-top: 3px; }
@media (max-width: 520px) { .pg-hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-hero__stats li:nth-child(3) { border-left: 0; } .pg-hero__stats li:nth-child(n+3) { border-top: 1px solid var(--st-rule); } }

/* The featured carousel, bigger on the homepage than it was on the store. */
.pg-home .st-hero { margin-top: 18px; }
.pg-home .st-hero__slide { padding-bottom: 60px; }   /* room for the controls under the text */
.pg-home .st-hero__slide { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; padding: 36px 40px 44px; }
.pg-home .st-hero__body h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
.pg-home .st-hero__desc { font-size: 1.08rem; max-width: 60ch; }
@media (max-width: 860px) { .pg-home .st-hero__slide { grid-template-columns: minmax(0, 1fr); padding: 24px 24px 56px; } }
.pg-hero__art { display: block; border: 1px solid var(--st-rule-strong); border-radius: var(--st-radius); overflow: hidden; box-shadow: var(--st-shadow); }
.pg-hero__art img { display: block; width: 100%; height: auto; }
.pg-hero__caption { font-size: 0.85rem; color: var(--st-ink-faint); margin: 10px 2px 0; }

.pg-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pg-proof__item { background: var(--st-panel); border: 1px solid var(--st-rule); border-radius: var(--st-radius); padding: 22px 22px 20px; }
.pg-proof__item h3 { font-size: 1.12rem; margin: 0 0 8px; }
.pg-proof__item p { margin: 0; color: var(--st-ink-soft); line-height: 1.6; }

.pg-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pg-video { display: block; text-decoration: none; color: var(--st-ink); }
.pg-video__frame { position: relative; display: block; aspect-ratio: 16 / 9; border: 1px solid var(--st-rule-strong); border-radius: var(--st-radius); overflow: hidden; background: rgb(var(--pg-bg-rgb)); }
.pg-video__frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--st-ease); }
.pg-video:hover .pg-video__frame img { transform: scale(1.03); }
.pg-video__play {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  border-radius: 50%; background: rgba(var(--pg-bg-rgb), 0.78); border: 2px solid var(--st-tan);
  display: flex; align-items: center; justify-content: center; color: var(--st-tan); font-size: 1.5rem;
}
.pg-video__title { display: block; font-size: 1.05rem; font-weight: 600; margin: 10px 2px 0; }

.pg-free { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pg-free a {
  display: inline-block; padding: 0.55em 1em; border: 1px solid var(--st-rule-strong); border-radius: var(--pg-radius);
  color: var(--st-ink); text-decoration: none; font-size: 0.95rem;
}
.pg-free a:hover { border-color: var(--st-tan); color: var(--st-tan); }

.pg-server {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  background: var(--st-panel); border: 1px solid var(--st-rule); border-radius: var(--st-radius); padding: 26px 28px;
}
.pg-server h2 { font-size: 1.45rem; margin: 0 0 6px; }
.pg-server p { margin: 0; color: var(--st-ink-soft); max-width: 70ch; line-height: 1.6; }
.pg-server__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Partner card, under the server panel. */
.pg-partner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 16px;
  background: var(--st-panel); border: 1px solid var(--st-rule); border-radius: var(--st-radius); padding: 20px 28px;
}
.pg-partner img { width: 72px; height: 72px; border-radius: 50%; flex: none; display: block; }
.pg-partner > div { flex: 1 1 280px; }
.pg-partner .eyebrow { margin: 0 0 4px; }
.pg-partner h3 { font-size: 1.2rem; margin: 0 0 4px; }
.pg-partner p { margin: 0; color: var(--st-ink-soft); max-width: 70ch; line-height: 1.6; }

@media (max-width: 960px) {
  .pg-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; }
  .pg-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .pg-proof, .pg-videos { grid-template-columns: minmax(0, 1fr); }
}
