/* Public pages: shared header and footer, content-page typography, and the dark "stage"
   theme used by the landing page. Builds on the tokens in app.css. */

/* The stage theme: the landing page looks like a darkened room with a projected screen.
   Contrast pairs used here are checked in test/site.test.js. */
.theme-stage {
  --stage: #1b1446;
  --stage-2: #261d5c;
  --stage-3: #33297a;
  --stage-line: #3d3388;
  --stage-text: #f4f2ff;
  --stage-muted: #bdb6ee;
  --stage-lemon: var(--brand-lemon);
  --stage-ultra: #6d6dff;
  --stage-action: #4646ee;

  --bg: var(--stage);
  --surface: var(--stage-2);
  --surface-2: var(--stage-3);
  --text: var(--stage-text);
  --muted: var(--stage-muted);
  --border: var(--stage-line);
  --accent: #5b5bf0;
  --accent-text: #ffffff;
  --accent-soft: var(--stage-3);
  --lemon: var(--stage-lemon);
  --good: #6fdc9b;
  --on-good: #0e2b19; /* text on a --good background */
  --good-fill: #17713d; /* the right answer's bar, dark enough for white text */
  --bad: #ff8fa3;
  --warn: #f3bd5a;
  --shadow: none;
  color-scheme: dark;
}

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }

a:focus-visible, [role="tab"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.theme-stage :focus-visible { outline-color: var(--lemon) !important; }
/* Links in running text: ultramarine is too dark on the stage, so they use the text color and
   keep the underline. */
.theme-stage main p a:not(.btn), .theme-stage main li a:not(.btn) { color: var(--text); }
/* The browser's default placeholder grey is too faint on the stage colors. */
.theme-stage ::placeholder { color: var(--muted); opacity: 1; }

/* ---------- header ---------- */

.site-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px max(16px, calc((100vw - 1200px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.site-top .brand { color: var(--text); text-decoration: none; font-size: 1.3rem; display: inline-flex; align-items: baseline; gap: 6px; }
/* The Beta badge is app.css's .beta; the site header's variant only differs in size and type. */
.site-top .beta {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  position: relative;
  top: -2px;
}
.site-menu-panel { display: contents; }
.site-nav { display: flex; gap: 4px; order: 1; margin-left: auto; }
.site-join { order: 2; }
.site-top-actions { order: 3; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--lemon); text-decoration-thickness: 4px; text-underline-offset: 6px; }

.site-join { display: flex; gap: 6px; align-items: center; position: relative; }
.site-join input {
  width: 9.5em;
  min-height: 40px;
  padding: 7px 10px;
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: 0.04em;
}
.site-join input::placeholder { letter-spacing: 0; font-family: var(--font); font-weight: 500; }
.site-join button { min-height: 40px; padding: 7px 14px; }
.site-join-error, .site-start-error {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(320px, 80vw);
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--bad);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
}
.site-start { white-space: nowrap; }
.site-signin { color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-signin:hover { color: var(--accent); }
.site-menu { display: none; }
.site-top-actions { display: flex; gap: 12px; align-items: center; position: relative; }

@media (max-width: 899px) {
  .site-top { flex-wrap: wrap; gap: 10px; }
  .site-menu { display: inline-flex; min-height: 40px; padding: 7px 10px; }
  .site-join { margin-left: auto; order: 0; gap: 4px; }
  .site-nav { margin-left: 0; }
  .site-join input { width: 6.4em; }
  .site-join button { padding: 7px 10px; }
  .site-menu-panel { display: none; order: 10; width: 100%; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 8px 0 6px; }
  .site-top.open .site-menu-panel { display: flex; }
  .site-nav { flex-direction: column; }
  .site-nav a { padding: 12px 8px; }
  .site-top-actions { flex-direction: column; align-items: stretch; }
  .site-signin { padding: 12px 8px; }
}
@media (max-width: 440px) {
  .site-top { gap: 6px; }
  .site-top .brand .beta { display: none; }
}

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

.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px max(16px, calc((100vw - 1200px) / 2)) 48px;
  color: var(--muted);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
.site-foot a { color: var(--text); font-weight: 600; }
.site-foot p { margin: 0; max-width: 60ch; }

/* ---------- buttons on public pages ---------- */

.btn-big { font-size: 1.1rem; min-height: 56px; padding: 12px 24px; border-radius: 14px; }
.btn-line { background: transparent; border: 2px solid currentColor; }
.btn-line:hover { background: var(--surface-2); filter: none; }

.soon {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--on-lemon);
  vertical-align: middle;
}

/* ---------- content pages ---------- */

.page { max-width: 1200px; margin: 0 auto; padding: 48px 16px 0; }
.page-head { max-width: 46rem; margin-bottom: 40px; }
.page-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.page-head p { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
/* Long-form text (Privacy). The site owns .prose; app.css doesn't style it. */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.5rem;margin: 48px 0 12px; }
.prose h3 { font-size: 1.15rem; margin: 24px 0 6px; }
.prose p, .prose li { font-size: 1.05rem; line-height: 1.6; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li + li { margin-top: 6px; }

.col-title { font-size: 1.6rem;margin-bottom: 20px; }
.page-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin: 4px 0 18px; }
.page-tabs [role="tab"] { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--text); font-weight: 650; }
.page-tabs [role="tab"]:hover { background: var(--surface-2); filter: none; }
.page-tabs [role="tab"][aria-selected="true"] { background: var(--text); color: var(--bg); }

.cols { display: grid; gap: 32px; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; gap: 56px; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; gap: 4px 14px; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 750;
  background: var(--accent-soft); color: var(--accent);
}
.steps h3 { margin: 4px 0 0; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--muted); line-height: 1.55; }

.soon-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 20px; }
.soon-grid article { border: 1px dashed var(--border); border-radius: 14px; padding: 18px; }
.soon-grid h3 { margin: 10px 0 6px; font-size: 1.1rem; }
.soon-grid p { margin: 0; color: var(--muted); }

.cta-band { margin-top: 56px; padding: 32px; border-radius: 20px; background: var(--accent-soft); display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; font-size: 1.5rem; }

/* Security: three-plane diagram */
.planes { display: grid; gap: 14px; margin: 8px 0 24px; }
@media (min-width: 860px) { .planes { grid-template-columns: 1.2fr 1fr 1fr; align-items: stretch; } }
.plane { border-radius: 16px; padding: 18px 20px; border: 2px solid var(--border); background: var(--surface); }
.plane h3 { margin: 0 0 8px; font-size: 1.15rem; }
.plane ul { margin: 0; padding-left: 1.1em; }
.plane li { line-height: 1.5; }
.plane.private { border-color: var(--good); }
.plane.server { border-style: dashed; }
.plane-note { font-size: 0.9rem; color: var(--muted); margin: 10px 0 0; }

/* Pricing */
.price-now { border: 2px solid var(--accent); border-radius: 20px; padding: 28px; background: var(--surface); max-width: 46rem; }
.price-now h2 { margin: 0 0 6px; font-size: 1.85rem; }
.price-now .big { font-family: var(--display); font-size: 3rem; font-weight: 700;line-height: 1; margin: 8px 0 14px; }
.free-list { columns: 2 16rem; column-gap: 32px; padding-left: 1.1em; }
.free-list li { break-inside: avoid; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
