/* ==========================================================================
   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 ------------------------------------------------------------------- */

.pg-header {
  position: sticky;
  top: 0;
  z-index: 1300;
  background: rgba(13, 11, 10, 0.94);
  border-bottom: 1px solid var(--st-rule-strong, rgba(243, 231, 216, 0.26));
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
}

/* The fixed Discord + basket cluster (.st-utilities) owns the top-right
   corner on store pages, so the bar keeps its right end clear for it. */
.pg-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 340px 0 24px;
}

.pg-brand {
  display: flex;
  flex-direction: column;
  flex: none;
  text-decoration: none;
  line-height: 1.05;
}
.pg-brand__name {
  font-family: 'Spectral SC', Georgia, serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--st-ink, #f3e7d8);
}
.pg-brand__by {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.74rem;
  color: var(--st-ink-faint, rgba(243, 231, 216, 0.48));
  margin-top: 3px;
}
.pg-brand:hover .pg-brand__name { color: var(--st-tan, #f2cda0); }

.pg-nav { min-width: 0; }
.pg-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pg-nav a {
  display: block;
  font-family: 'Spectral SC', Georgia, serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--st-ink-soft, rgba(243, 231, 216, 0.72));
  text-decoration: none;
  padding: 0.7em 0.8em;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.pg-nav a:hover,
.pg-nav a:focus-visible { color: var(--st-tan, #f2cda0); }
.pg-nav a[aria-current="page"] {
  color: var(--st-ink, #f3e7d8);
  border-bottom-color: var(--st-brass, #c2a15c);
}
.pg-nav a[href="/store/all-access"] { color: var(--st-brass, #c2a15c); }

/* Line the fixed cluster up with the bar instead of the old masthead line. */
body.has-pg-header .st-utilities { top: 13px; }

@media (max-width: 1500px) {
  .pg-header__inner { gap: 18px; }
  .pg-brand__by { display: none; }
  /* The fixed Discord + basket cluster would cover the last link; the server
     is still one click away in the footer and the homepage. */
  .pg-nav a[href="/server"] { display: none; }
  .pg-nav a { padding: 0.7em 0.55em; letter-spacing: 0.09em; font-size: 0.76rem; }
}
@media (max-width: 1280px) {
  .pg-header__inner { padding-right: 150px; }
}

/* Narrow screens: brand on the first line (the cluster sits beside it), the
   links on a second line that scrolls sideways rather than wrapping. */
@media (max-width: 1060px) {
  .pg-header__inner { flex-wrap: wrap; gap: 0; padding: 10px 110px 0 16px; min-height: 0; }
  .pg-brand { padding: 6px 0 8px; }
  .pg-nav { flex-basis: 100%; margin: 0 -110px 0 -16px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .pg-nav::-webkit-scrollbar { display: none; }
  .pg-nav a { font-size: 0.74rem; padding: 0.75em 0.65em; }
}

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

.pg-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--st-rule-strong, rgba(243, 231, 216, 0.26));
  background: rgba(12, 10, 9, 0.9);
  color: var(--st-ink-soft, rgba(243, 231, 216, 0.72));
  font-family: 'Spectral', Georgia, serif;
}
.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: 'Spectral SC', Georgia, serif; font-size: 1.1rem; font-weight: 700; color: var(--st-ink, #f3e7d8); margin: 0 0 8px; }
.pg-footer p { margin: 0; line-height: 1.6; font-size: 0.95rem; }
.pg-footer h2 {
  font-family: 'Spectral SC', Georgia, serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--st-tan, #f2cda0);
  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, rgba(243, 231, 216, 0.72)); text-decoration: none; }
.pg-footer a:hover { color: var(--st-tan, #f2cda0); }
.pg-footer__legal {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 28px;
  border-top: 1px solid var(--st-rule, rgba(243, 231, 216, 0.13));
  font-size: 0.85rem;
  color: var(--st-ink-faint, rgba(243, 231, 216, 0.48));
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.pg-footer__legal a { color: var(--st-ink-faint, rgba(243, 231, 216, 0.48)); }
@media (max-width: 860px) { .pg-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .pg-footer__inner { grid-template-columns: minmax(0, 1fr); } }

/* 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: 'Spectral SC', Georgia, serif; font-size: 1.55rem; color: var(--st-ink); 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: #0d0b0a; }
.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(13, 11, 10, 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: 999px;
  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; }

@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); }
}
