/* pixel-stroke.com — shared chrome + layout for every non-landing
 * page (about, donate, download, login, signup, docs).
 *
 * Tokens + visual treatment mirror landing.css so each marketing page
 * feels like a slice of the same site, not a generic template. The
 * landing's design language: full-dark navy palette (`--bg-*`,
 * `--text-*`, `--accent` indigo), RGB-cube logo, "icon-signature"
 * treatment on every primary surface (thick navy outline + solid
 * bottom-offset shadow), Söhne-style display headlines.
 *
 * This file owns: page-level layout, the sticky header + nav, the
 * footer, prose/article styles, button system, form chrome (used by
 * /login + /signup), docs-page chrome (/docs/*).
 *
 * Breakpoints (mobile-first):
 *   mobile  ≤ 640px    (default)
 *   tablet  641-1024px (--tablet)
 *   desktop > 1024px   (--desktop)
 */

:root {
  /* Palette mirrors landing.css. Defined at :root so EVERY page
   * inherits them — landing.css's `.stroke {...}` block shadows
   * these on the home page with the same values. */
  --bg-0:        #06070f;
  --bg-1:        #0a0a1e;
  --bg-2:        #10142a;
  --bg-3:        #161b35;
  --bg-hover:    #1e2442;
  --bg-active:   #242a4a;

  --text-1:      #e8e9f2;
  --text-2:      #a0a4b8;
  --text-3:      #6d7290;
  --text-4:      #4a4e68;

  --brand-red:    #e02948;
  --brand-green:  #3fc26a;
  --brand-blue:   #3a8fff;
  --brand-yellow: #ffd24c;

  --red:    #ec2a2a;
  --coral:  #ff5b3e;
  --yellow: #ffd23c;
  --lime:   #c4f024;
  --blue:   #3060ff;
  --cyan:   #00d4ff;
  --violet: #7a3bff;

  --accent:      #6c5ce7;
  --accent-soft: rgba(108, 92, 231, 0.18);

  --rule:    rgba(255, 255, 255, 0.08);
  --outline: var(--bg-0);

  --font-ui: 'Söhne', 'Inter Display', 'Inter', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

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

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-feature-settings: 'ss01' on, 'cv11' on;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 160ms cubic-bezier(0.2, 0.9, 0.25, 1);
}
a:hover { color: var(--brand-yellow); }

button, input, select, textarea { font: inherit; color: inherit; }

::selection {
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  background: var(--bg-3);
  color: var(--text-1);
  padding: 10px 16px;
  border-radius: 6px;
  border: 2px solid var(--outline);
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { top: 16px; }

/* ---------------------------------------------------------------- *
 * Header — sticky, blurred, brand-mark + nav. Mirrors the landing's
 * `.stroke-header` so visually the site reads as one product.
 * ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}
.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-1);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.site-brand img {
  width: auto;
  height: 26px;
}
.site-brand:hover { color: var(--text-1); }
.site-nav ul {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 160ms ease;
}
.site-nav a:hover { color: var(--text-1); }
.site-nav .site-nav-cta {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--outline);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 4px 0 0 var(--outline);
  transition: all 200ms cubic-bezier(0.2, 0.9, 0.25, 1);
}
.site-nav .site-nav-cta:hover {
  background: var(--brand-red);
  color: #fff;
  transform: translate(0, -1px);
  box-shadow: 0 5px 0 0 var(--outline);
}

/* ---------------------------------------------------------------- *
 * Main
 * ---------------------------------------------------------------- */

.site-main {
  flex: 1;
  padding: 80px 32px 120px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2; /* above #stroke-canvas */
}

/* Live painterly scroll-stroke. The canvas is viewport-fixed and
 * sits behind the page content; site-stroke.js draws a morphing
 * brushstroke down the right side that breathes, transitions
 * smooth → paint → pixel → smooth as you scroll, swells around the
 * cursor, and pulses ambiently when the cursor's away from the
 * stroke band. Falls back to nothing when prefers-reduced-motion
 * is set. */
#stroke-canvas {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 520px) {
  #stroke-canvas { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #stroke-canvas { display: none; }
}

/* ---------------------------------------------------------------- *
 * Prose article — used by /about, /donate, /download, /docs
 * ---------------------------------------------------------------- */

.prose {
  max-width: 760px;
  font-size: 18px;
}
.prose h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--text-1);
}
.prose h1 + p {
  font-size: 21px;
  color: var(--text-2);
  margin-bottom: 48px;
  line-height: 1.5;
}
.prose h2 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 56px 0 16px;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.prose h2::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--brand-red);
  display: inline-block;
}
.prose p {
  margin: 0 0 20px;
  color: var(--text-2);
  line-height: 1.65;
}
.prose p a {
  color: var(--brand-blue);
  font-weight: 500;
}
.prose ul, .prose ol {
  margin: 0 0 24px;
  padding-left: 24px;
  color: var(--text-2);
}
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--brand-yellow);
}
.prose pre {
  background: var(--bg-0);
  border: 2px solid var(--outline);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  box-shadow: 0 4px 0 var(--outline);
  margin: 24px 0;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
  display: block;
}
.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-2);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-style: italic;
}

/* ---------------------------------------------------------------- *
 * Buttons — icon-signature treatment shared with the landing
 * ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--outline);
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.2, 0.9, 0.25, 1);
  white-space: nowrap;
}
.btn-red {
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 4px 0 0 var(--outline);
}
.btn-red:hover {
  background: var(--brand-yellow);
  color: var(--bg-0);
  transform: translate(0, -2px);
  box-shadow: 0 6px 0 0 var(--outline);
}
.btn-ghost {
  background: transparent;
  color: var(--text-1);
}
.btn-ghost:hover {
  background: var(--text-1);
  color: var(--bg-1);
}

/* ---------------------------------------------------------------- *
 * Auth form — used by /login + /signup
 * ---------------------------------------------------------------- */

.auth-shell {
  max-width: 460px;
  margin: 40px auto;
}
.auth-card {
  background: var(--bg-2);
  border: 2px solid var(--outline);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--outline), 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 40px 32px;
}
.auth-heading {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-1);
}
.auth-lede {
  margin: 0 0 28px;
  color: var(--text-2);
  line-height: 1.55;
}
.auth-error {
  margin: -12px 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--brand-red);
  border-radius: 8px;
  color: var(--text-1);
  font-size: 14px;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 8px; }
.auth-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.auth-field input {
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--text-1);
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-submit {
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--outline);
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 0 var(--outline);
  transition: all 200ms cubic-bezier(0.2, 0.9, 0.25, 1);
}
.auth-submit:hover {
  background: var(--brand-yellow);
  color: var(--bg-0);
  transform: translate(0, -1px);
  box-shadow: 0 5px 0 0 var(--outline);
}
.auth-alt {
  margin-top: 24px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}
.auth-alt a {
  color: var(--brand-blue);
  font-weight: 500;
}

/* ---------------------------------------------------------------- *
 * Docs — TOC sidebar + content
 * ---------------------------------------------------------------- */

.docs-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
.docs-toc {
  position: sticky;
  top: 100px;
  padding: 24px;
  background: var(--bg-2);
  border: 2px solid var(--outline);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--outline);
}
.docs-toc-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 16px;
}
.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.docs-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: all 140ms ease;
}
.docs-toc a:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}
.docs-toc a.is-active {
  background: var(--accent-soft);
  color: var(--text-1);
  font-weight: 600;
}
.docs-content { min-width: 0; } /* prevent grid overflow */
.docs-content .prose { max-width: none; }

/* Pill badges next to docs headings. Used to mark API status (stable
 * / experimental / coming soon) without writing it in prose. */
.doc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--text-2);
  vertical-align: middle;
  margin-left: 8px;
}
.doc-badge.is-stable { color: var(--brand-green); border-color: rgba(63, 194, 106, 0.4); }
.doc-badge.is-soon   { color: var(--brand-yellow); border-color: rgba(255, 210, 76, 0.4); }
.doc-badge.is-exp    { color: var(--accent); border-color: rgba(108, 92, 231, 0.4); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-0);
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer-tagline {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
}
.site-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}
.site-footer-links a {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-footer-links a:hover { color: var(--text-1); }

/* ---------------------------------------------------------------- *
 * Responsive
 * ---------------------------------------------------------------- */

@media (max-width: 1024px) {
  .docs-shell { grid-template-columns: 1fr; gap: 32px; }
  .docs-toc { position: static; }
}
@media (max-width: 640px) {
  .site-header-inner { padding: 14px 20px; gap: 14px; }
  .site-nav ul { gap: 12px; }
  .site-nav a:not(.site-nav-cta) { display: none; }
  .site-main { padding: 48px 20px 80px; }
  .auth-card { padding: 28px 20px; }
  .site-footer-inner { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
}
