/* Pathwright site: tokens follow pathwright.com (warm paper, Inter Display
   headings, blue accent, large rounded cards), paired for light and dark. */

@font-face { font-family: "PW Inter"; src: url("/site/assets/fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PW Inter"; src: url("/site/assets/fonts/inter-medium.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "PW Inter Display"; src: url("/site/assets/fonts/inter-display-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PW Inter Display"; src: url("/site/assets/fonts/inter-display-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PW Plex Serif"; src: url("/site/assets/fonts/ibm-plex-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PW Plex Serif"; src: url("/site/assets/fonts/ibm-plex-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PW Plex Serif"; src: url("/site/assets/fonts/ibm-plex-serif-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PW Plex Serif"; src: url("/site/assets/fonts/ibm-plex-serif-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --pw-bg: light-dark(#f5f4f3, #141416);
  --pw-surface: light-dark(#ffffff, #1d1d20);
  --pw-surface-2: light-dark(#ecebe8, #26262a);
  --pw-ink: light-dark(#1e1f24, #f5f4f3);
  --pw-text: light-dark(#333132, #d6d5d2);
  --pw-muted: light-dark(#6e6d69, #9b9a96);
  --pw-line: light-dark(rgb(30 31 36 / 0.1), rgb(255 255 255 / 0.1));
  --pw-blue: light-dark(#2f6cf0, #6f9bff);
  --pw-blue-bright: #407cff;
  --pw-blue-soft: light-dark(rgb(64 124 255 / 0.1), rgb(111 155 255 / 0.16));
  --pw-amber-soft: light-dark(#fdf0d5, #3a2f17);
  --pw-amber: light-dark(#8a5a00, #f3c46b);
  --pw-radius: 20px;
  --pw-radius-lg: 28px;
  --pw-wide: 76rem;
  --pw-reading: 44rem;
  --pw-header: 68px;
  --pw-font: "PW Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pw-font-display: "PW Inter Display", "PW Inter", Inter, sans-serif;
  --pw-font-serif: "PW Plex Serif", "IBM Plex Serif", Georgia, serif;
  --pw-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --pmx-font-body: var(--pw-font);
  --pmx-font-heading: var(--pw-font-display);
  --pmx-color-bg: var(--pw-bg);
  --pmx-color-fg: var(--pw-text);
  --pmx-color-surface: var(--pw-surface);
  --pmx-color-border: var(--pw-line);
  --pmx-color-accent: var(--pw-blue);
  --pmx-color-link: var(--pw-blue);
  --pmx-color-focus: var(--pw-blue-bright);
  --pmx-radius: 14px;
  --pmx-document-measure: var(--pw-reading);
  /* .site-main supplies the page gutter. */
  --pmx-prose-gutter: 0px;
}

html { background: var(--pw-bg); }
body {
  margin: 0;
  background: var(--pw-bg);
  color: var(--pw-text);
  font-family: var(--pw-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Skip link */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--pw-ink); color: var(--pw-bg); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--pw-bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header-inner {
  display: flex; align-items: center; gap: 2rem;
  max-width: 88rem; margin: 0 auto; padding: 0 1.75rem; height: var(--pw-header);
}
.site-brand {
  display: inline-flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
  color: var(--pw-ink); text-decoration: none;
  font-family: var(--pw-font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.03em;
}
.site-brand img { border-radius: 8px; }
.site-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav .pmx-nav-list { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav .pmx-nav-link {
  display: block; padding: 0.45rem 0.75rem; border-radius: 999px;
  color: var(--pw-muted); font-weight: 500; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.site-nav .pmx-nav-link:hover { color: var(--pw-ink); }
.site-nav [data-pmx-active] > .pmx-nav-link,
.site-nav .pmx-nav-link[aria-current="page"] { color: var(--pw-ink); background: var(--pw-surface-2); }
.site-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

/* Main column */
.site-workspace { display: flex; align-items: flex-start; }
.site-workspace > main { flex: 1; min-width: 0; }
.site-main { padding: 3.5rem 1.75rem 6rem; outline: none; }
.pmx-document { padding-inline: 0; }
.pmx-document[data-type="page"] { --pmx-document-measure: var(--pw-wide); }

/* Typography */
.pmx-document h1, .pmx-document h2, .pmx-document h3, .pmx-document h4 {
  color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600;
}
.pmx-document h1 { font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance; }
.pmx-document h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; letter-spacing: -0.035em; }
.pmx-document h3 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.02em; }
.pmx-prose { font-size: 1.0625rem; line-height: 1.65; }
.pmx-prose a:not(.pmx-heading-anchor, .card, .person-chip, .edition-chip, .change-row, .section-card) {
  color: var(--pmx-color-link); text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
.pmx-prose a:not(.pmx-heading-anchor, .card, .person-chip, .edition-chip, .change-row, .section-card):hover { text-decoration-thickness: 2px; }
.pmx-prose img[data-pmx-image] { border-radius: var(--pw-radius); }
.pmx-prose blockquote { border-left: 3px solid var(--pw-blue-bright); padding-left: 1.1rem; color: var(--pw-ink); }
.pmx-prose hr { border: 0; border-top: 1px solid var(--pw-line); }
.pmx-prose code { font-size: 0.9em; }
.pmx-heading-anchor { color: var(--pw-muted); }
.pmx-document[data-type="page"] .pmx-prose > p,
.pmx-document[data-type="page"] .pmx-prose > ul,
.pmx-document[data-type="page"] .pmx-prose > ol { max-width: var(--pw-reading); }

/* Lead paragraph under a page title */
.lead { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.5; color: var(--pw-muted); max-width: 40rem; }

/* Meta and bylines */
.page-shell { max-width: var(--pw-reading); margin: 0 auto; }
.page-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.9rem;
  margin: 0 0 1.25rem; color: var(--pw-muted); font-size: 0.9rem; font-weight: 500;
}
.page-meta > :empty { display: none; }
.page-meta a { color: var(--pw-muted); text-decoration: none; }
.page-meta a:hover { color: var(--pw-ink); }
.page-meta-series { padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--pw-blue-soft); color: var(--pw-blue); }
.article-shell .pmx-document > .pmx-prose:first-child .pmx-heading.level-h1,
.change-shell .pmx-document > .pmx-prose:first-child .pmx-heading.level-h1 { text-align: center; }
.article-shell .pmx-document > .pmx-prose:first-child img[data-pmx-image] { width: 100%; margin-top: 1rem; }
.page-byline { display: flex; justify-content: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--pw-line); }
.page-byline ul, .page-byline ol { display: flex; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.person-chip {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border-radius: 999px; background: var(--pw-surface); border: 1px solid var(--pw-line);
  color: var(--pw-ink); font-weight: 500; font-size: 0.92rem; text-decoration: none;
}
.person-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--pw-surface-2); }
.person-chip img[src=""] { display: none; }
.status-badge { display: none; }
.status-badge[data-status="draft"] {
  display: inline-block; margin-left: 0.6rem; padding: 0.1rem 0.55rem; vertical-align: 0.2em;
  border-radius: 999px; background: var(--pw-amber-soft); color: var(--pw-amber);
  font-family: var(--pw-font); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase;
}

/* Cards */
.card-grid > *:is(ul, ol, div),
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.5rem;
  margin: 0; padding: 0; list-style: none;
}
.card-grid > *:is(ul, ol, div) { grid-column: 1 / -1; }
.card-grid li { margin: 0; padding: 0; }
.card-grid li::marker { content: none; }
.card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border-radius: var(--pw-radius-lg); background: var(--pw-surface); border: 1px solid var(--pw-line);
  color: var(--pw-text); text-decoration: none;
  transition: transform 0.25s var(--pw-ease), box-shadow 0.25s var(--pw-ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.35); }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--pw-surface-2); overflow: hidden; }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-media:has(img[src=""]) { display: none; }
.card-body { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.15rem 1.3rem 1.35rem; }
.card-body > :empty { display: none; }
.card-eyebrow { color: var(--pw-blue); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; }
.card-title { color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.15; letter-spacing: -0.025em; }
.card-text { color: var(--pw-muted); font-size: 0.95rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { margin-top: auto; padding-top: 0.35rem; color: var(--pw-muted); font-size: 0.85rem; }
.person-card { flex-direction: row; align-items: center; gap: 0.9rem; padding: 1rem; }
.person-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--pw-surface-2); flex-shrink: 0; }
.person-card .card-body { padding: 0; }
.person-card .card-title { font-size: 1.05rem; }
.person-card img[src=""] { visibility: hidden; }

/* Changelog timeline */
.change-list > *:is(ul, ol, div) { margin: 0; padding: 0; list-style: none; }
.change-list li { margin: 0; padding: 0; }
.change-list li::marker { content: none; }
.change-row {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.5rem;
  padding: 1.35rem 0; border-top: 1px solid var(--pw-line); color: var(--pw-text); text-decoration: none;
}
.change-row:hover .change-title { color: var(--pw-blue); }
.change-date { color: var(--pw-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.change-body { display: flex; flex-direction: column; gap: 0.3rem; }
.change-title { color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; transition: color 0.15s; }
.change-text { color: var(--pw-muted); }
.change-text:empty { display: none; }

/* Home and section heroes */
.hero { max-width: 56rem; margin: 1.5rem auto 4rem; text-align: center; }
.hero h1 { margin: 0 0 1.25rem; }
.hero .lead { margin: 0 auto; }
.section-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin: 0 0 4.5rem;
}
@media (min-width: 1100px) { .section-cards:has(> :nth-child(5)) { grid-template-columns: repeat(5, 1fr); } }
.section-card {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 1.5rem; min-height: 11rem;
  border-radius: var(--pw-radius-lg); background: var(--pw-surface); border: 1px solid var(--pw-line);
  color: var(--pw-text); text-decoration: none; transition: transform 0.25s var(--pw-ease), box-shadow 0.25s var(--pw-ease);
}
.section-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.35); }
.section-card strong { color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.03em; }
.section-card span { color: var(--pw-muted); font-size: 0.95rem; line-height: 1.45; }
.section-card .section-card-cta { margin-top: auto; color: var(--pw-blue); font-weight: 500; }
.section-card.is-collider { background: #fff7f3; border-color: #fbd6c9; }
.section-card.is-collider strong { color: #ee212e; }
.section-card.is-collider span { color: #6b4a42; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--pw-blue); font-weight: 500; text-decoration: none; white-space: nowrap; }
.home-section { margin: 0 0 5rem; }

/* Help center */
.help-shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 3.5rem; max-width: var(--pw-wide); margin: 0 auto; }
.help-sidebar {
  position: sticky; top: calc(var(--pw-header) + 1.5rem); align-self: start;
  max-height: calc(100vh - var(--pw-header) - 3rem); overflow-y: auto; padding-right: 0.5rem; font-size: 0.92rem;
}
.help-sidebar-home { display: block; margin: 0 0 1rem; color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; text-decoration: none; }
.help-sidebar .pmx-nav-list { margin: 0; padding: 0; list-style: none; }
.help-sidebar .pmx-nav-link { display: block; padding: 0.35rem 0.6rem; border-radius: 10px; color: var(--pw-muted); font-weight: 500; text-decoration: none; line-height: 1.3; }
.help-sidebar .pmx-nav-link:hover { color: var(--pw-ink); background: var(--pw-surface-2); }
.help-sidebar .pmx-nav-link[aria-current="page"] { color: var(--pw-ink); background: var(--pw-surface); box-shadow: inset 0 0 0 1px var(--pw-line); }
.help-sidebar .pmx-nav-item > .pmx-nav-list { display: none; margin: 0.15rem 0 0.4rem 0.75rem; padding-left: 0.5rem; border-left: 1px solid var(--pw-line); }
.help-sidebar .pmx-nav-item[data-pmx-active] > .pmx-nav-list { display: block; }
.help-sidebar .pmx-nav-item .pmx-nav-item .pmx-nav-link { font-weight: 400; font-size: 0.88rem; }
.help-main { min-width: 0; }
.help-main .pmx-document { --pmx-document-measure: var(--pw-reading); margin-inline: 0; }
.help-main .pmx-document h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
.help-main .pmx-prose > ul:has(> li > a:only-child) { padding: 0; list-style: none; }
.help-main .pmx-prose > ul:has(> li > a:only-child) > li { margin: 0; border-top: 1px solid var(--pw-line); }
.help-main .pmx-prose > ul:has(> li > a:only-child) > li > a { display: block; padding: 0.8rem 0.2rem; color: var(--pw-ink); font-weight: 500; text-decoration: none; }
.help-main .pmx-prose > ul:has(> li > a:only-child) > li > a:hover { color: var(--pw-blue); }
.help-main nav[aria-label="Breadcrumb"], .help-main .pmx-breadcrumbs { font-size: 0.88rem; color: var(--pw-muted); margin-bottom: 1.5rem; }
.help-main .pmx-breadcrumbs a { color: var(--pw-muted); text-decoration: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--pw-line); }
.site-footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
  max-width: 88rem; margin: 0 auto; padding: 2.25rem 1.75rem 3rem; color: var(--pw-muted); font-size: 0.9rem;
}
.site-footer .site-brand { font-size: 1rem; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer-links a { color: var(--pw-muted); text-decoration: none; }
.site-footer-links a:hover { color: var(--pw-ink); }
.site-footer-note { margin: 0 0 0 auto; }

/* Narrow screens */
@media (max-width: 860px) {
  .site-header-inner { gap: 1rem; padding: 0 1rem; }
  .site-brand span { display: none; }
  .site-main { padding: 2rem 1rem 4rem; }
  .help-shell { grid-template-columns: 1fr; gap: 1.5rem; }
  /* On phones the breadcrumbs carry navigation; the sidebar shrinks to its home link. */
  .help-sidebar { position: static; max-height: none; padding: 0; }
  .help-sidebar .pmx-navigation, .help-sidebar nav { display: none; }
  .help-sidebar-home { margin: 0; font-size: 0.95rem; }
  .change-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .site-footer-note { margin-left: 0; }
}

/* Inside a frame: the Pathwright app's changelog panel, about 400px wide.
   PathMX sets data-pmx-embedded before first paint, so the chrome never flashes. */
.embed-bar { display: none; }
html[data-pmx-embedded] .embed-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  background: color-mix(in srgb, var(--pw-bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--pw-line);
}
.embed-bar-title {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--pw-ink); text-decoration: none;
  font-family: var(--pw-font-display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em;
}
.embed-bar-title img { border-radius: 7px; }
.embed-bar-close {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--pw-muted); cursor: pointer;
}
.embed-bar-close:hover { background: var(--pw-surface-2); color: var(--pw-ink); }
.embed-bar-close:focus-visible { outline: 2px solid var(--pw-blue-bright); outline-offset: 2px; }
html[data-pmx-embedded] :is(.skip-navigation, .site-header, .site-footer, .hero) { display: none; }
html[data-pmx-embedded] .site-main { padding: 0.5rem 1.25rem 3rem; }
html[data-pmx-embedded] .pmx-document h1 { font-size: 1.85rem; line-height: 1.1; }
html[data-pmx-embedded] .change-shell .pmx-document > .pmx-prose:first-child .pmx-heading.level-h1 { text-align: left; }
html[data-pmx-embedded] .page-meta { justify-content: flex-start; margin: 1rem 0 0.75rem; }
html[data-pmx-embedded] .pmx-prose { font-size: 1rem; }
html[data-pmx-embedded] .change-row { grid-template-columns: 1fr; gap: 0.3rem; padding: 1rem 0; }
html[data-pmx-embedded] .change-list .change-row:first-child { border-top: 0; padding-top: 0; }
html[data-pmx-embedded] .change-title { font-size: 1.1rem; }

/* People */
.person-shell { text-align: center; }
.person-avatar { display: block; width: 96px; height: 96px; margin: 0 auto 1.25rem; border-radius: 50%; object-fit: cover; background: var(--pw-surface-2); }
.person-avatar[src=""] { display: none; }
.person-shell .pmx-document .pmx-prose { text-align: center; }
.person-writing { margin-top: 3.5rem; text-align: left; }
.person-writing h2 { margin: 0 0 1rem; color: var(--pw-ink); font-family: var(--pw-font-display); font-weight: 600; font-size: 1.4rem; letter-spacing: -0.03em; }
.person-writing .pmx-graph-backlinks-actions:empty { display: none; }
.person-writing .pmx-graph-backlinks ul { margin: 0; padding: 0; list-style: none; }
.person-writing .pmx-graph-backlinks li { border-top: 1px solid var(--pw-line); }
.person-writing .pmx-graph-backlinks a { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.8rem 0.2rem; color: var(--pw-ink); font-weight: 500; text-decoration: none; }
.person-writing .pmx-graph-backlinks a:hover { color: var(--pw-blue); }
.person-writing .pmx-graph-backlinks a > span:last-child { display: flex; justify-content: space-between; gap: 1rem; flex: 1; }
.person-writing .pmx-graph-backlinks small { color: var(--pw-muted); font-weight: 400; white-space: nowrap; }
.page-meta .person-chip { padding-block: 0.2rem; }
