/* psolution — shared public design system.
   One stylesheet for every public page (landing, SEO tools, sample report,
   extension install). Light/dark via [data-theme] on <html>, toggled by
   /static/site.js. Mirrors the signed-in app's tokens in style.css. */

/* Self-hosted variable font (same file as the app shell) so public pages get
   the same crisp typography without a third-party font request. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter.woff2") format("woff2-variations");
}

:root {
  --bg: #0a0d14; --panel: #121826; --panel2: #1a2133; --line: #273149;
  --text: #e9edf7; --muted: #97a3ba; --muted2: #6b7896;
  --brand1: #5653e6; --brand2: #8448f0; --link: #9aa4ff;
  --green: #3fb950; --amber: #e3b341; --red: #f97583; --blue: #4f8ff7;
  --pill-green: rgba(63,185,80,.15); --pill-amber: rgba(227,179,65,.15); --pill-red: rgba(249,117,131,.15);
  --grad: linear-gradient(135deg, var(--brand1), var(--brand2));
  --shadow: 0 1px 2px rgba(0,0,0,.25);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.38), 0 3px 10px rgba(0,0,0,.22);
  --header-bg: rgba(16,21,34,.82);
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --font: "Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,
          BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}
:root[data-theme="light"] {
  --bg: #f5f7fb; --panel: #ffffff; --panel2: #eef1f8; --line: #e2e8f2;
  --text: #101a33; --muted: #5b6b85; --muted2: #8a97ad;
  --brand1: #4f46e5; --brand2: #7c3aed; --link: #4f46e5;
  --green: #188039; --amber: #966a00; --red: #ce2233; --blue: #2f6fe0;
  --pill-green: rgba(24,128,57,.1); --pill-amber: rgba(150,106,0,.12); --pill-red: rgba(206,34,51,.1);
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 18px 44px rgba(16,24,40,.14), 0 3px 10px rgba(16,24,40,.06);
  --header-bg: rgba(255,255,255,.86);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }

h1 { font-size: 30px; line-height: 1.18; letter-spacing: -.02em; margin: 26px 0 8px; color: var(--text); }
h2 { font-size: 20px; margin: 34px 0 10px; color: var(--text); letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
p, li { color: var(--muted); font-size: 14.5px; }
.lead { color: var(--muted); font-size: 16px; max-width: 680px; }
.note { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); font-size: 12.5px; }
.micro { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---------- header / nav ---------- */
.pub-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  margin: 0 -20px 4px; padding: 8px 20px;
}
.pub-mast { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 52px; }
.pub-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.pub-brand:hover { text-decoration: none; }
.pub-logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; letter-spacing: .5px;
}
.pub-head-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pub-nav { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.pub-nav > a { color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.pub-nav > a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
/* The header CTA is a real button: keep the shared .pub-btn metrics and its
   gradient on hover (the link rule above would otherwise flatten it). */
.pub-nav > a.pub-btn { padding: 8px 14px; border-radius: 9px; font-weight: 700; }
.pub-nav > a.pub-btn:hover { background: var(--grad); color: #fff; }
.pub-nav > a.pub-btn.ghost:hover { background: transparent; color: var(--text); }
/* the tools menu is a <details>, not a content card — undo the generic rule */
.pub-menu { position: relative; background: none; border: 0; padding: 0; margin: 0; }
.pub-menu > summary {
  list-style: none; cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px; user-select: none; white-space: nowrap;
}
.pub-menu > summary::-webkit-details-marker { display: none; }
.pub-menu > summary::after { content: " ▾"; font-size: 10px; }
.pub-menu[open] > summary, .pub-menu > summary:hover { color: var(--text); background: var(--panel2); }
.pub-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  z-index: 60;
}
/* mobile menu button */
.pub-burger {
  display: none; align-items: center; gap: 8px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 13.5px;
  font-weight: 700; cursor: pointer;
}
.pub-burger:hover { border-color: var(--brand1); }
.pub-burger-ico { width: 16px; height: 2px; background: currentColor; position: relative; border-radius: 2px; }
.pub-burger-ico::before, .pub-burger-ico::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 2px;
  background: currentColor; border-radius: 2px;
}
.pub-burger-ico::before { top: -5px; }
.pub-burger-ico::after { top: 5px; }
.pub-menu-list a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: 13.5px; }
.pub-menu-list a:hover { background: var(--panel2); text-decoration: none; }
.pub-menu-list small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; margin-top: 1px; }
.pub-theme {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pub-theme:hover { border-color: var(--brand1); }
[hidden] { display: none !important; }
.pub-btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 9px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 700; text-decoration: none; border: 1px solid transparent;
}
.pub-btn:hover { text-decoration: none; }
.pub-btn.primary { background: var(--grad); color: #fff; }
.pub-btn.primary:hover { filter: brightness(1.06); }
.pub-btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.pub-btn.ghost:hover { border-color: var(--brand1); }

/* ---------- buttons / badges ---------- */
.cta {
  display: inline-block; margin-top: 20px; color: #fff; text-decoration: none;
  background: var(--grad); padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 15px;
}
.cta:hover { filter: brightness(1.06); text-decoration: none; }
.cta2 { display: inline-block; margin: 12px 16px 0 0; color: var(--link); font-size: 14px; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pass { background: var(--pill-green); color: var(--green); }
.caution { background: var(--pill-amber); color: var(--amber); }
.fail { background: var(--pill-red); color: var(--red); }
.rubric { background: var(--pill-amber); color: var(--amber); }
.score { font-weight: 800; color: var(--brand1); }

/* ---------- cards / grids ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin: 14px 0; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.related a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; font-size: 14px; }
.related a:hover { border-color: var(--brand1); text-decoration: none; }
.related small { color: var(--muted); display: block; margin-top: 3px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 14px 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: var(--panel2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ---------- forms: capture / calc / seed ---------- */
.cap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0; }
.cap input[type=email] { flex: 1 1 220px; min-width: 0; min-height: 44px; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 11px 12px; font: inherit; font-size: 14px; }
.cap button, .calc button { min-height: 44px; background: var(--grad); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 700; font-size: 14px; cursor: pointer; }
.cap button:hover, .calc button:hover { filter: brightness(1.06); }
.cap .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cap-msg { flex: 1 1 100%; margin: 0; color: var(--green); font-size: 13px; min-height: 1em; }
.calc {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px; align-items: end;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin: 16px 0;
}
.calc.seed { grid-template-columns: minmax(0, 1fr) auto; }
.calc label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); margin: 0; font-weight: 600; }
.calc input { display: block; width: 100%; box-sizing: border-box; min-height: 44px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 11px 12px; font: inherit; font-size: 14px; }
.calc input:focus, .cap input:focus { outline: none; border-color: var(--brand1); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.seed label { flex: 1 1 260px; }
.seed input { width: 100%; min-width: 220px; }
.out { min-height: 22px; font-size: 15px; color: var(--text); margin: 8px 0 0; }

/* ---------- report bits (sample + generated report) ---------- */
.hero { padding: 22px 0 6px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand1); background: var(--pill-green); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
ul.checks { list-style: none; margin: 6px 0 0; padding: 0; }
ul.checks li { padding: 8px 0 8px 26px; position: relative; border-bottom: 1px dashed var(--line); color: var(--muted); }
ul.checks li:last-child { border-bottom: 0; }
ul.checks li::before { content: "\2713"; position: absolute; left: 0; top: 8px; color: var(--green); font-weight: 800; }
.facts { display: grid; grid-template-columns: 1fr; gap: 8px 20px; margin-top: 10px; }
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } }
.fact { border-top: 1px solid var(--line); padding-top: 8px; }
.fact-k { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand1); }
.fact-v { display: block; font-size: 14px; color: var(--text); margin-top: 2px; }
.deephead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.deephead h3 { flex: 1 1 auto; margin: 0; }
dl.deep { display: grid; grid-template-columns: 1fr; gap: 10px 20px; margin: 0; }
@media (min-width: 720px) { dl.deep { grid-template-columns: 1fr 1fr; } }
dt { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand1); }
dd { margin: 0; font-size: 14px; color: var(--text); }
.chip { display: inline-block; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 12px; margin: 2px 4px 2px 0; color: var(--text); }
details:not(.pub-menu) { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0; }
summary { font-weight: 700; cursor: pointer; color: var(--text); }
details:not(.pub-menu) p { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; }

/* ---------- prose (legal pages) ---------- */
.prose h2 { font-size: 17px; margin: 26px 0 6px; }
.prose p, .prose li { color: var(--muted); font-size: 14.5px; }
.prose ul { margin: 8px 0 0; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.upd { color: var(--muted2); font-size: 12px; margin: 0 0 8px; }

/* ---------- forms (contact + any public form) ---------- */
.field { margin: 14px 0 0; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px;
  font: inherit; font-size: 14px; min-height: 44px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand1); box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.btn-submit {
  margin-top: 16px; cursor: pointer; color: #fff; border: 0;
  background: var(--grad); padding: 12px 22px; border-radius: 10px;
  font: inherit; font-weight: 700; font-size: 15px;
}
.btn-submit:hover { filter: brightness(1.06); }
.btn-submit:disabled { opacity: .65; cursor: default; }
.msg { margin-top: 14px; font-size: 14px; color: var(--muted); }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* keyboard focus ring everywhere */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand1); outline-offset: 2px;
}
.final { background: var(--grad); color: #fff; border-radius: 18px; padding: 30px 24px; text-align: center; margin: 22px 0; }
.final h2 { color: #fff; }
.final p { color: rgba(255,255,255,.9); max-width: 560px; margin: 6px auto 18px; }
.final .pub-btn.primary { background: #fff; color: var(--brand1); }
.final .pub-btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }

/* ---------- footer ---------- */
.pub-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 40px; }
.pub-foot-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 720px) { .pub-foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.pub-foot h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.pub-foot a { display: block; color: var(--muted); font-size: 13.5px; padding: 3px 0; text-decoration: none; }
.pub-foot a:hover { color: var(--text); text-decoration: none; }
.pub-foot-tag { color: var(--muted); font-size: 13px; margin: 8px 0 0; max-width: 240px; }
.pub-foot-base { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; color: var(--muted2); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ---------- responsive ---------- */
/* keep the header on one row down to ~820px by dropping the optional link */
@media (max-width: 820px) {
  .pub-nav > a[href="/sample"] { display: none; }
}

@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .wrap { padding: 20px 16px 48px; }
  .pub-head { margin: 0 -16px 4px; padding: 8px 16px; }
  .pub-burger { display: inline-flex; }
  .pub-nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 2px; margin: 6px 0 2px; padding-top: 8px; border-top: 1px solid var(--line);
  }
  .pub-head[data-nav-open="1"] .pub-nav { display: flex; }
  .pub-nav > a {
    padding: 12px 12px; font-size: 14.5px; border-radius: 9px;
  }
  .pub-head-tools { gap: 6px; }
  .pub-menu > summary { padding: 9px 10px; font-size: 13px; }
  .pub-theme { padding: 9px 11px; font-size: 13px; }
  .pub-nav .pub-btn { width: 100%; justify-content: center; padding: 12px 14px; font-size: 14.5px; }
  /* forms: full-width controls and a comfortable tap target */
  .calc, .calc.seed { grid-template-columns: minmax(0, 1fr); }
  .cap { flex-direction: column; align-items: stretch; }
  .calc input, .calc button, .cap input, .cap button { width: 100%; }
  .table-wrap { margin-left: 0; margin-right: 0; }
}

@media (max-width: 420px) {
  .pub-brand span:last-child { font-size: 14.5px; }
  .pub-mast { gap: 10px; }
  .pub-head-tools { gap: 5px; }
  .pub-burger { padding: 9px 10px; }
  .pub-burger > span:last-child { display: none; }
  .pub-menu > summary { padding: 9px 8px; }
  .pub-theme { padding: 9px 9px; }
  h1 { font-size: 23px; }
}

/* belt-and-braces: a bare table never widens the whole page on a phone */
@media (max-width: 640px) {
  .wrap > table, .card > table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media print {
  .pub-head, .pub-nav, .pub-burger, .cta, .final, .pub-foot { display: none; }
  body { background: #fff; color: #000; }
  .card, table { box-shadow: none; }
}
