/* Prime Edge Systems - shared site styles.
 *
 * The colour tokens are copied from the application's own palette
 * (lib/src/core/theme/pes_colors.dart) so the site and the app cannot drift
 * apart. Nothing here is loaded from a third party: no web fonts, no
 * analytics, no CDN. A site promising that the app phones nobody should not
 * itself phone somebody.
 */

/* Brand palette, taken from the application's own tokens so the page and
     the app cannot drift apart. */
  :root {
    --base:      #0A0B0D;
    --raised:    #14161A;
    --overlay:   #1C1F25;
    --border:    #2B303A;
    --text:      #F3F5F8;
    --muted:     #9AA1AA;
    --accent:    #FC2023;
    --accent-dk: #D40E13;

    --nav-h:     65px;
  }

  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    /* The nav is sticky, so an anchor must not land underneath it. */
    scroll-padding-top: calc(var(--nav-h) + 20px);
  }

  body {
    margin: 0;
    background: var(--base);
    color: var(--text);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
          Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  /* Nothing on any page is meant to be reached by scrolling sideways. */
  html, body { overflow-x: clip; }
  @supports not (overflow: clip) {
    body { overflow-x: hidden; }
  }

  .wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }

  header { border-bottom: 1px solid var(--border); padding-bottom: 24px; margin-bottom: 40px; }
  .eyebrow {
    font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--accent); font-weight: 600; margin: 0 0 12px;
  }
  h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
  .updated { color: var(--muted); font-size: 14px; margin: 0; }

  h2 {
    font-size: clamp(20px, 4vw, 26px); line-height: 1.25; letter-spacing: -.01em;
    margin: 56px 0 16px; padding-top: 8px;
  }
  h3 { font-size: 17px; margin: 32px 0 10px; }

  p, li { color: #DDE1E6; }
  p { margin: 0 0 16px; }
  ul { padding-left: 22px; margin: 0 0 16px; }
  li { margin-bottom: 8px; }
  strong { color: var(--text); font-weight: 600; }
  code {
    background: var(--overlay); border: 1px solid var(--border);
    padding: 2px 6px; border-radius: 4px; font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    word-break: break-all;
  }

  pre {
    background: var(--overlay); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; margin: 0 0 24px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Inside a block the border and padding are the pre's job, and a command
     line must not break-all — a wrapped path is a command that will not run. */
  pre code {
    background: none; border: 0; padding: 0; font-size: 14px;
    line-height: 1.6; word-break: normal; white-space: pre;
  }

  .lead {
    background: var(--raised); border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px; padding: 24px; margin: 0 0 8px;
  }
  .lead p:last-child { margin-bottom: 0; }
  .lead .big { font-size: 19px; font-weight: 600; color: var(--text); }

  .note {
    background: var(--overlay); border: 1px solid var(--border);
    border-radius: 10px; padding: 18px 20px; margin: 24px 0;
    color: var(--muted); font-size: 15px;
  }
  .note p:last-child { margin-bottom: 0; }

  /* Tables scroll rather than forcing the page to; phones are the common
     case for a policy linked from a store listing. */
  .table-scroll { overflow-x: auto; margin: 0 0 24px; -webkit-overflow-scrolling: touch; }
  table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
  th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
  th { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
  tbody tr:last-child td { border-bottom: none; }

  a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(252,32,35,.35); }
  a:hover { border-bottom-color: var(--accent); }

  footer {
    margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 14px;
  }

  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

  /* Printing a policy is a normal thing to want to do. */
  @media print {
    body { background: #fff; color: #000; }
    .lead, .note { border-color: #999; background: #fff; }
    p, li { color: #000; }
    a { color: #000; }
  }

/* ---------------------------------------------------------------- site ---
 * Everything below is used by the pages other than the privacy policy.
 */

.wide { max-width: 940px; }

/* A focus ring that is visible on the near-black page, on the raised
   surfaces, and on the red button alike. */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Hidden until focused, and hidden by clipping rather than by being parked
   off-screen, which would give the page something to scroll sideways to. */
.skip-link {
  position: absolute; top: 0; left: 0;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  background: var(--overlay); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0; font-size: 15px; font-weight: 600; z-index: 100;
}
.skip-link:focus {
  width: auto; height: auto; overflow: visible; clip-path: none;
  top: 12px; left: 12px; padding: 10px 16px;
}

/* --- navigation ------------------------------------------------------- */

/* Sticky, and slightly heavier once the page has moved. */
nav.site {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
  transition: background-color .25s ease, box-shadow .25s ease, padding .25s ease;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav.site {
    background: rgba(10, 11, 13, .78);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
  }
  nav.site.is-scrolled { background: rgba(10, 11, 13, .94); }
}
nav.site.is-scrolled {
  padding-top: 9px; padding-bottom: 9px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .9);
  border-bottom-color: #383E4A;
}
nav.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  border: 0;
}
nav.site .brand img {
  width: 30px; height: 30px; display: block;
  transition: transform .25s ease;
}
nav.site.is-scrolled .brand img { transform: scale(.9); }
nav.site .brand .wordmark { white-space: nowrap; }
nav.site .brand .wordmark span { color: var(--accent); }
nav.site a { border: 0; color: var(--muted); font-size: 15px; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--text); }
nav.site .links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
}
nav.site .links a { position: relative; padding: 4px 0; }
nav.site .links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
nav.site .spacer { flex: 1 1 auto; }

@media (max-width: 560px) {
  nav.site { gap: 10px 16px; padding-left: 16px; padding-right: 16px; }
  nav.site .spacer { display: none; }
  nav.site .brand { flex: 1 0 100%; }
  nav.site .links { gap: 16px; font-size: 14px; }
  nav.site a { font-size: 14px; }
}

/* --- hero ------------------------------------------------------------- */

.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); }
.hero .tagline {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 28px;
}

/* The home page hero puts the mark and a device beside the words. */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  position: relative;
}
@media (min-width: 860px) {
  .hero-split { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; }
}
.hero-mark {
  width: 76px; height: 76px; display: block; margin: 0 0 22px;
}
/* Kept inside its container: an element wider than the page is an element the
   page can be scrolled sideways to reach. */
.hero-glow {
  position: absolute;
  inset: -20% 0 auto;
  height: 460px;
  background: radial-gradient(70% 70% at 72% 28%, rgba(252, 32, 35, .17), rgba(252, 32, 35, 0) 72%);
  pointer-events: none;
  z-index: -1;
}

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--overlay);
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0A0B0D;
}
.button.primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.button:hover { border-color: #4A515D; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 0 0 32px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--raised);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; font-size: 15px; color: var(--muted); }
.card::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}
.card:hover, .card:focus-within {
  border-color: #414855;
  background: var(--overlay);
  transform: translateY(-3px);
}
.card:hover::after, .card:focus-within::after { transform: scaleX(1); }
.card .icon {
  display: block; width: 24px; height: 24px; margin: 0 0 12px;
  color: var(--accent);
}
.card .icon svg { width: 100%; height: 100%; display: block; }

.pill {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
}

.platforms { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.platform {
  flex: 1 1 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--raised);
  transition: border-color .2s ease, transform .2s ease;
}
.platform:hover { border-color: #414855; transform: translateY(-2px); }
.platform h3 { margin: 0 0 4px; font-size: 15px; }
.platform p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }

.status {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

/* --- counters --------------------------------------------------------- */

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.stats li {
  margin: 0;
  padding: 22px 20px;
  background: var(--raised);
}
.stat-num {
  display: block;
  font-size: clamp(26px, 4.5vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-num .unit { font-size: .5em; color: var(--muted); font-weight: 600; margin-left: 4px; }
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}
.stats li:last-child .stat-num { color: var(--accent); }

/* --- device frame ----------------------------------------------------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 272px;
  margin: 0 auto;
}
.phone-frame {
  position: relative;
  padding: 9px;
  border-radius: 34px;
  background: linear-gradient(155deg, #3A4049 0%, #14161A 38%, #21252C 100%);
  box-shadow:
    0 32px 60px -24px rgba(0, 0, 0, .95),
    0 0 0 1px rgba(255, 255, 255, .05) inset;
}
.phone-frame::after {
  content: "";
  position: absolute;
  top: 17px; left: 50%; transform: translateX(-50%);
  width: 54px; height: 4px; border-radius: 4px;
  background: rgba(0, 0, 0, .55);
  pointer-events: none;
}
.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  background: var(--base);
}

/* --- screenshot gallery ----------------------------------------------- */

.gallery { margin: 8px 0 0; }
.gallery-inner { margin: 24px 0 0; }

/* Without JavaScript every screenshot is shown, one after another, with its
   caption. The tab list is only useful when there is script to drive it. */
.gallery-tabs, .gallery-controls { display: none; }
.gallery-stage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 36px 24px;
  margin: 0;
}
.gallery-stage figure { margin: 0; }
.gallery-stage figcaption {
  margin: 16px auto 0;
  max-width: 34ch;
  text-align: center;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.5;
}
.gallery-stage figcaption strong { display: block; color: var(--text); font-size: 15.5px; margin-bottom: 3px; }

.js .gallery-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (min-width: 820px) {
  .js .gallery-inner { grid-template-columns: 262px minmax(0, 1fr); gap: 40px; }
}
.js .gallery-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 820px) {
  .js .gallery-tabs {
    flex-direction: column;
    overflow-x: visible;
    padding: 0;
    position: sticky;
    top: calc(var(--nav-h) + 20px);
  }
}
.gallery-tab {
  display: block;
  flex: 0 0 auto;
  width: auto;
  text-align: left;
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
@media (min-width: 820px) {
  .gallery-tab { width: 100%; white-space: normal; }
}
.gallery-tab:hover { color: var(--text); background: var(--raised); }
.gallery-tab[aria-selected="true"] {
  color: var(--text);
  background: var(--raised);
  border-color: var(--border);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}
.js .gallery-stage { display: block; }
.js .gallery-stage figure[hidden] { display: none; }
.js .gallery-stage figcaption { min-height: 3.2em; }

.js .gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 0;
}
.gallery-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: border-color .18s ease, background-color .18s ease;
}
.gallery-nav:hover { border-color: #4A515D; background: var(--overlay); }
.gallery-nav svg { width: 16px; height: 16px; display: block; }
.gallery-count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
  text-align: center;
}

/* --- privacy panel ---------------------------------------------------- */

.donate {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--raised);
  padding: 24px;
  margin: 32px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.donate img { width: 132px; height: 132px; border-radius: 8px; background: #fff; }
.donate div { flex: 1 1 260px; }
.donate p { margin: 0 0 12px; }

.site-footer-mark {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  color: var(--text); font-weight: 600;
}
.site-footer-mark img { width: 26px; height: 26px; display: block; }

/* --- scroll reveal ---------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s ease, transform .55s ease;
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover, .platform:hover { transform: none; }
  .button:hover { transform: none; }
}

@media print {
  nav.site, .cta, .donate, .gallery, .hero-glow, .skip-link, .gallery-controls { display: none; }
  .stats { border-color: #999; }
  .stats li { background: #fff; }
}
