/* Chatbot PGG — chatbotpgg.com
 *
 * Tokens are lifted verbatim from the iOS app's Theme/ folder so the site
 * reads as a continuation of the product rather than a lookalike:
 *   AppBackground.swift  -> --bg-top / --bg-bottom / --glow
 *   AppColor.swift       -> --warm-* / --accent
 *   Layout.swift         -> radii and the 4pt spacing scale
 *   AppFont.swift        -> SF Pro Rounded throughout
 *   Motion.swift         -> --ease-breathe and the 2.2s breath
 *
 * No build step and no inline styles anywhere: the CSP in `_headers` sets
 * style-src 'self', so a single stray style="" attribute would be dropped
 * silently. Everything visual lives in this file.
 */

/* ---------------------------------------------------------------- tokens */

:root {
  /* AppBackground.swift:19-20 — RGB 0.09/0.09/0.11 → 0.03/0.03/0.04 */
  --bg-top: #17171c;
  --bg-bottom: #08080a;

  /* AppColor.swift — the only five hard-coded colours in the whole app */
  --warm-blue: #8cb3ff;
  --warm-lilac: #b8adfa;
  --warm-pink: #ff8c99;
  --warm-orange: #ffa64d;
  --accent: #3379ff;

  /* The signature gradient. Used sparingly on purpose — hairlines, small
     marks, the beam. Never as a large fill; it cheapens instantly. */
  --warm: linear-gradient(135deg, var(--warm-blue), var(--warm-lilac), var(--warm-pink), var(--warm-orange));

  --text: #f5f5f7;
  --text-2: rgba(235, 235, 245, 0.62);
  --text-3: rgba(235, 235, 245, 0.38);
  --hairline: rgba(255, 255, 255, 0.1);

  /* Layout.swift:11-31 */
  --s-xxs: 4px;  --s-xs: 8px;   --s-sm: 12px; --s-md: 16px;
  --s-lg: 20px;  --s-xl: 24px;  --s-xxl: 32px; --s-xxxl: 48px;
  --r-icon: 12px; --r-card: 16px; --r-bubble: 20px;
  --r-pill: 22px; --r-bar: 28px;  --r-sheet: 28px;

  --page: 1080px;

  /* Motion.swift:18 — easeInOut 2.2s, autoreversing */
  --ease-breathe: cubic-bezier(0.42, 0, 0.58, 1);

  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
          "Segoe UI", system-ui, sans-serif;
}

/* ---------------------------------------------------------------- base */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-bottom);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* AppBackground.swift: vertical gradient + a lilac glow low on the screen.
   Fixed so it behaves like the app's backdrop rather than scrolling away. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(440px 440px at 50% 103%, rgba(184, 173, 250, 0.12), transparent 70%),
    linear-gradient(to bottom, var(--bg-top), var(--bg-bottom));
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--text); text-decoration-color: var(--text-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--warm-lilac); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding-left: 1.25em; }
li { margin: var(--s-xs) 0; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
}

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--s-lg); }
.center { text-align: center; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }

/* Visible only to screen readers — used for the skip link and icon labels. */
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- glass */

/* Glass.swift's iOS 18 fallback: .ultraThinMaterial + a 0.5px hairline. */
.glass {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
}

/* ---------------------------------------------------------------- mark */

/* The only web-usable asset is the app icon: a white neon knot on PURE
   black. `screen` over a dark backdrop is the identity operation — the black
   disappears exactly and the glow survives, with no alpha channel and no
   hand-cutting. It only works on dark, and this site is always dark. */
.mark {
  mix-blend-mode: screen;
  width: 100%;
  height: auto;
}

/* If a browser drops the blend (Safari can, under a backdrop-filter
   ancestor) a black square would appear. The vignette behind it makes that
   failure read as a deliberate dark tile rather than a broken image. */
.mark-slot {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 26%;
}
.mark-slot::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 173, 250, 0.16), transparent 68%);
  pointer-events: none;
}

.mark-hero { width: 132px; animation: breathe 2.2s var(--ease-breathe) infinite alternate; }
.mark-nav  { width: 28px; }
.mark-foot { width: 26px; }

@keyframes breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.045); }
}

/* ---------------------------------------------------------------- beam */

/* BorderBeamEffect.swift: an angular gradient rotating around the border.
   @property makes the angle animatable; the doubled mask leaves only a ring.
   Registered outside :root because @property must be top-level. */
@property --beam-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.beam { position: relative; isolation: isolate; }
.beam::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 0deg,
    var(--warm-orange) 35deg,
    var(--warm-pink) 60deg,
    var(--warm-lilac) 85deg,
    transparent 130deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: beam-spin 6s linear infinite;
  pointer-events: none;
}
@keyframes beam-spin {
  to { --beam-angle: 360deg; }
}

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
.nav-in {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  flex: 0 0 auto;
}
.nav-links {
  display: flex;
  gap: var(--s-lg);
  margin-left: auto;
  font-size: 15px;
}
.nav-links a { color: var(--text-2); text-decoration: none; }
.nav-links a:hover { color: var(--text); }

.soon {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--hairline);
  white-space: nowrap;
}

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

.hero { padding: var(--s-xxxl) 0 var(--s-xxl); text-align: center; }
.hero h1 {
  font-size: clamp(34px, 7vw, 58px);
  margin: var(--s-lg) 0 var(--s-md);
}
.hero .lede {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-2);
  max-width: 34ch;
  margin: 0 auto;
}
.hero-mark { margin: 0 auto; width: 132px; }

.grad {
  background: var(--warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------- composer replica */

/* A live rebuild of InputBar.swift rather than a screenshot: there are no
   App Store screenshots yet, and a real artefact beats a fabricated mock-up.
   Radius 28 = Radius.inputBar; the 40px circles = Size.inputControl. */
.composer {
  max-width: 560px;
  margin: var(--s-xxl) auto 0;
  border-radius: var(--r-bar);
  background: rgba(14, 14, 16, 0.92);
  padding: var(--s-md) var(--s-md) var(--s-sm);
  text-align: left;
}
.composer-top {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  color: var(--text-3);
  font-size: 16px;
  min-height: 30px;
}
.model-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 19px;
  border-radius: 1px;
  background: var(--warm);
  animation: blink 1.1s steps(1) infinite;
  vertical-align: -4px;
}
@keyframes blink { 50% { opacity: 0; } }

.composer-row {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  margin-top: var(--s-sm);
  color: var(--text-2);
}
.composer-row .spacer { margin-left: auto; }

/* Inline stroke icons rather than emoji. Emoji render in full colour and at
   the system's own weight, which fights a monochrome interface — the app uses
   SF Symbols, and this is the closest the web gets without a font. */
.ic { width: 20px; height: 20px; display: block; }
.ic-lg { width: 19px; height: 19px; }
.dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}
.dot.primary { background: var(--warm); }

/* ---------------------------------------------------------------- sections */

section { padding: var(--s-xxxl) 0; }
.sec-head { max-width: 46ch; margin-bottom: var(--s-xl); }
.sec-head h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: var(--s-sm); }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-xs);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-md);
}
.card {
  border-radius: var(--r-card);
  padding: var(--s-lg);
}
.card h3 { font-size: 18px; margin-bottom: var(--s-xs); }
.card p { color: var(--text-2); font-size: 15px; }
.card .ico {
  width: 34px; height: 34px;
  border-radius: var(--r-icon);
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: var(--s-sm);
  font-size: 17px;
}

/* ---------------------------------------------------------------- models */

.provider { margin-bottom: var(--s-lg); }
.provider h3 {
  font-size: 15px;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: var(--s-xs);
}
.chips { display: flex; flex-wrap: wrap; gap: var(--s-xs); }
.chip {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.chip.free { border-color: rgba(184, 173, 250, 0.4); }
.chip.house {
  border: 0;
  background: var(--warm);
  color: #14141a;
  font-weight: 700;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-lg);
  font-size: 14px;
  color: var(--text-2);
}
.swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: 0;
}
.swatch.free { border: 1.5px solid rgba(184, 173, 250, 0.6); }
.swatch.house { background: var(--warm); }

/* ---------------------------------------------------------------- pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-md);
  align-items: start;
}
.plan {
  border-radius: var(--r-sheet);
  padding: var(--s-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--hairline);
}
.plan.featured { background: rgba(10, 10, 12, 0.9); border-color: transparent; }
.plan .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--warm);
  color: #14141a;
  margin-bottom: var(--s-sm);
}
.plan h3 { font-size: 15px; color: var(--text-2); font-weight: 600; }
.price { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin: var(--s-xxs) 0; }
.price small { font-size: 15px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan .note { font-size: 14px; color: var(--text-3); }
.plan ul { list-style: none; padding: 0; margin: var(--s-md) 0 0; }
.plan li { font-size: 15px; color: var(--text-2); padding-left: 1.4em; position: relative; }
.plan li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--warm-lilac);
  font-weight: 700;
}

.legal-note {
  margin-top: var(--s-lg);
  font-size: 13px;
  color: var(--text-3);
  max-width: 68ch;
}

/* ---------------------------------------------------------------- faq */

details {
  border-bottom: 0.5px solid var(--hairline);
  padding: var(--s-md) 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  list-style: none;
  display: flex;
  gap: var(--s-sm);
  align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  color: var(--warm-lilac);
  font-weight: 700;
  flex: 0 0 auto;
}
details[open] summary::before { content: "–"; }
details p { color: var(--text-2); font-size: 15px; margin-top: var(--s-xs); padding-left: 1.35em; }

/* ---------------------------------------------------------------- footer */

.foot {
  border-top: 0.5px solid var(--hairline);
  padding: var(--s-xxl) 0;
  margin-top: var(--s-xxl);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg);
  align-items: flex-start;
  justify-content: space-between;
}
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-lg); font-size: 15px; }
.foot-links a { color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot .legal { font-size: 13px; color: var(--text-3); margin-top: var(--s-md); max-width: 62ch; }

/* ---------------------------------------------------------------- doc pages */

/* Terms / Privacy / Support. Narrower measure — these are read, not scanned. */
.doc { max-width: 760px; padding: var(--s-xxl) var(--s-lg) var(--s-xxxl); margin: 0 auto; }
.doc h1 { font-size: clamp(30px, 5vw, 40px); margin-bottom: var(--s-xs); }
.doc h2 {
  font-size: 21px;
  margin: var(--s-xxl) 0 var(--s-sm);
  padding-top: var(--s-md);
  border-top: 0.5px solid var(--hairline);
}
.doc h3 { font-size: 17px; margin: var(--s-lg) 0 var(--s-xxs); }
.doc p, .doc li { color: var(--text-2); font-size: 16px; }
.doc p { margin: var(--s-sm) 0; }
.doc strong { color: var(--text); font-weight: 600; }
.doc .updated { color: var(--text-3); font-size: 14px; margin-bottom: var(--s-xl); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: var(--s-md) 0;
}
.doc th, .doc td {
  text-align: left;
  padding: var(--s-xs) var(--s-sm);
  border-bottom: 0.5px solid var(--hairline);
  vertical-align: top;
  color: var(--text-2);
}
.doc th { color: var(--text); font-weight: 600; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.callout {
  border-radius: var(--r-card);
  padding: var(--s-md);
  margin: var(--s-md) 0;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--warm-lilac);
}
.callout p { margin: 0; }

.toc { margin: var(--s-lg) 0 0; padding: 0; list-style: none; columns: 2; column-gap: var(--s-xl); }
.toc li { margin: var(--s-xxs) 0; }
.toc a { color: var(--text-2); font-size: 15px; text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }

/* ---------------------------------------------------------------- 404 */

.mid {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  text-align: center;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .toc { columns: 1; }
  section { padding: var(--s-xxl) 0; }
  .foot-in { flex-direction: column; }
}

/* Blur and perpetual motion are the two things that make low-end devices
   stutter, so both go together when the user has asked for less. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mark-hero, .caret { animation: none; }
  .beam::before { animation: none; background: none; }
  .beam { border: 0.5px solid var(--hairline); }
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20, 20, 24, 0.94); }
}
