/*
 * Stylesheet for the static articles under /articles.
 *
 * These pages ship no JavaScript on purpose: they are the crawler-facing half
 * of the site, readable by Google, Bing, and AI crawlers without a render pass.
 * That rules out Panda and @idz/ui, so the landing palette is restated here as
 * literals. The landing itself hardcodes these same hexes (see its components),
 * so this is consistent with existing practice rather than a second system.
 *
 * MUST stay an external stylesheet. The production CSP is
 * `style-src 'self' 'nonce-<NONCE>'` and only the SPA shell gets a nonce
 * injected, so an inline <style> on these pages would be blocked outright.
 */

:root {
  --canvas: #111115;
  --surface: #1a1a20;
  --surface-line: #26262e;
  --ink: #f0ede8;
  --ink-muted: #8a8580;
  --ink-dim: #555560;
  --accent: #d4456b;
  --accent-soft: #c17ba8;
  --gradient: linear-gradient(135deg, #9b6bb5 0%, #d4456b 50%, #e8705e 100%);
  --measure: 720px;
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--surface-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

/*
 * /static/logo.svg is a byte-for-byte copy of
 * packages/ui/src/components/Logo/Logo.svg, whose paths are fill="currentColor".
 * Inside an <img> that resolves to black and vanishes on this canvas, so the
 * logo is drawn as a CSS mask and --ink supplies the colour. Same result the
 * landing header gets from <Logo color="#F0EDE8" size="44px" />.
 *
 * To update the logo, re-copy that file. Do NOT substitute LogoWithFX.svg: it
 * references url(#gradient-brand-down), which the apps define at root via
 * SvgGradientFills and which does not exist on a static page.
 *
 * 44x30 keeps the 16:11 viewBox aspect, matching the landing's rendered width.
 */
.wordmark {
  display: block;
  width: 44px;
  height: 30px;
  background-color: var(--ink);
  -webkit-mask: url("/static/logo.svg") no-repeat center / contain;
  mask: url("/static/logo.svg") no-repeat center / contain;
}

.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.site-header nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
}

main {
  padding: 56px 0 72px;
}

/* ------------------------------------------------------------ typography */

h1 {
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 20px;
}

h2 {
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 56px 0 16px;
}

h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
}

p {
  margin: 0 0 20px;
  color: var(--ink-muted);
}

.lede {
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 40px;
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 16px;
}

strong {
  color: var(--ink);
  font-weight: 500;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-dim);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

ul,
ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--ink-muted);
}

li {
  margin-bottom: 10px;
}

li::marker {
  color: var(--ink-dim);
}

hr {
  border: 0;
  border-top: 1px solid var(--surface-line);
  margin: 56px 0;
}

blockquote {
  margin: 0 0 24px;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ code */

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

p code,
li code,
td code {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink);
  overflow-wrap: break-word;
}

pre {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 0 0 24px;
  overflow-x: auto;
  line-height: 1.6;
}

pre code {
  color: var(--ink);
  white-space: pre;
}

/* ---------------------------------------------------------------- tables */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 24px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  min-width: 480px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--surface-line);
}

th {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

td {
  color: var(--ink-muted);
}

/* ----------------------------------------------------------------- cards */

.callout {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 0 0 28px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card-list li {
  margin-bottom: 14px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  padding: 20px 22px;
  text-decoration: none;
}

.card:hover {
  border-color: var(--ink-dim);
}

.card h2,
.card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 15px;
}

/* -------------------------------------------------------------- cta band */

.cta {
  background-image: var(--gradient);
  border-radius: 14px;
  padding: 28px 30px;
  margin: 56px 0 0;
  color: #1a1015;
}

.cta h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #1a1015;
}

.cta p {
  margin: 0 0 18px;
  color: #3a2129;
}

.cta a {
  display: inline-block;
  background: #14141a;
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

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

.related {
  margin-top: 56px;
}

.related h2 {
  font-size: 20px;
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--surface-line);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--ink-dim);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}

.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink-muted);
}

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

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 23px;
    margin-top: 44px;
  }

  .lede {
    font-size: 18px;
  }

  main {
    padding: 36px 0 52px;
  }

  pre {
    padding: 14px 16px;
    font-size: 13px;
  }

  .cta {
    padding: 24px 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .card {
    transition:
      color 0.15s ease,
      border-color 0.15s ease,
      text-decoration-color 0.15s ease;
  }
}
