/*
 * Pro Softwares Support: design system.
 * Tokens follow prosoftwares.dev (ivory paper, ink type, caramel and terracotta accents,
 * Fraunces for headings, Jost for text). Self-hosted fonts only; no scripts.
 */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-opsz.woff2") format("woff2-variations"),
       url("/assets/fonts/fraunces-latin-opsz.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/jost-latin-wght.woff2") format("woff2-variations"),
       url("/assets/fonts/jost-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  /* Brand palette (prosoftwares.dev) */
  --c-ivory: #f7f1e7;
  --c-paper: #fbf7f0;
  --c-cream: #efe5d6;
  --c-sand: #dccab2;
  --c-tan: #c9a888;
  --c-ink: #1d1916;
  --c-charcoal: #2c2622;
  --c-umber: #3b302a;
  --c-body: #3d3631;
  --c-muted: #6a5f55;
  --c-caramel: #b67a4d;
  --c-terracotta: #a35a36;
  --c-accent-text: #8c4b2b;
  --c-line: #e0d5c6;
  --c-line-strong: #cbbba6;

  /* Roles */
  --bg: var(--c-ivory);
  --surface: var(--c-paper);
  --surface-tint: var(--c-cream);
  --text: var(--c-body);
  --heading: var(--c-ink);
  --muted: var(--c-muted);
  --link: var(--c-accent-text);
  --link-hover: var(--c-ink);
  --link-line: #8c4b2b66;
  --line: var(--c-line);
  --line-strong: var(--c-line-strong);
  --accent: var(--c-caramel);
  --focus: var(--c-accent-text);
  --btn-bg: var(--c-ink);
  --btn-bg-hover: var(--c-umber);
  --btn-fg: var(--c-paper);
  --code-bg: #f1e8da;
  --header-bg: #f7f1e7e0;
  --shape-a: var(--c-sand);
  --shape-b: var(--c-cream);
  --shadow-soft: 0 1px 2px #3c28190f, 0 12px 32px -14px #3c28192e;

  /* Type */
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Jost", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-display: clamp(2.4rem, 1.7rem + 2.8vw, 3.75rem);
  --fs-h1: clamp(2rem, 1.6rem + 1.6vw, 2.85rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 0.7vw, 1.85rem);
  --fs-h3: 1.2rem;
  --fs-lead: clamp(1.1rem, 1.04rem + 0.3vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;
  --tracking-wide: 0.3em;
  --tracking-caps: 0.14em;

  /* Space and size */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3rem, 2rem + 4vw, 4.5rem);
  --container: 76rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --measure: 42rem;
  --header-h: 4.25rem;
  --radius: 4px;
  --radius-l: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1916;
    --surface: #27211d;
    --surface-tint: #2c2521;
    --text: #e2d7c9;
    --heading: #f7f0e5;
    --muted: #b8a999;
    --link: #e8ad82;
    --link-hover: #f7f0e5;
    --link-line: #e8ad8270;
    --line: #3a312b;
    --line-strong: #56483e;
    --accent: #c98b5c;
    --focus: #f0b98f;
    --btn-bg: #fbf7f0;
    --btn-bg-hover: #efe5d6;
    --btn-fg: #1d1916;
    --code-bg: #312923;
    --header-bg: #1e1916e6;
    --shape-a: #3a2e27;
    --shape-b: #2c2521;
    --shadow-soft: 0 1px 2px #0000004d, 0 12px 32px -14px #00000080;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  overflow-x: clip;
}

/* The faint paper grain of the parent site. Light mode only. */
@media (prefers-color-scheme: light) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

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

h1, h2, h3, h4 {
  margin: 0;
  color: var(--heading);
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--link);
  text-decoration: underline 1px;
  text-decoration-color: var(--link-line);
  text-underline-offset: 0.22em;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

strong { color: var(--heading); font-weight: 550; }

::selection { background: var(--c-sand); color: var(--c-ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-small);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

/* ---------- Small shared pieces ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9em;
  width: fit-content;
  margin: 0 0 1rem;
  color: var(--link);
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  line-height: 1.4;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.lead {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  font-weight: 350;
  line-height: 1.55;
}

.rule {
  width: 4.5rem;
  height: 3px;
  margin: 0;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
}

.icon { flex: none; width: 1em; height: 1em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); color: var(--btn-fg); }
.btn .icon { transition: transform 0.25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--heading); }
.btn--ghost:hover { background: var(--surface); border-color: var(--heading); color: var(--heading); }
.btn--small { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: var(--fs-small); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--heading);
  font-weight: 500;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.35em;
}
.text-link:hover { color: var(--link); text-decoration-color: currentColor; }
.text-link .icon { transition: transform 0.25s var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.2rem 0.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: var(--heading);
  text-decoration: none;
}
.brand:hover { color: var(--heading); }
.brand__mark {
  display: block;
  flex: none;
  height: 1.9rem;
  aspect-ratio: 546 / 420;
  background: currentColor;
  -webkit-mask: url("/assets/ps-monogram.svg") center / contain no-repeat;
  mask: url("/assets/ps-monogram.svg") center / contain no-repeat;
}
@media (forced-colors: active) {
  .brand__mark { background: CanvasText; forced-color-adjust: none; }
}
.brand__name {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__section {
  padding-left: 0.85rem;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  line-height: 1.1;
  white-space: nowrap;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding-block: 0.5rem;
  color: var(--text);
  font-size: 0.975rem;
  text-decoration: none;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav__link:hover,
.site-nav__link[aria-current] { color: var(--heading); }
.site-nav__link:hover::after,
.site-nav__link[aria-current]::after { transform: none; }
.site-nav__link .icon { width: 0.8em; height: 0.8em; opacity: 0.7; }

/* Narrow screens: the same links in a disclosure (no script needed). */
.menu { display: none; }

@media (max-width: 52rem) {
  :root { --header-h: 3.75rem; }
  .site-nav { display: none; }
  .brand__mark { height: 1.65rem; }
  .brand__name { font-size: 0.78rem; letter-spacing: 0.24em; }
  .brand__section { font-size: 0.85rem; padding-left: 0.7rem; }
  .brand { gap: 0.7rem; }

  .menu { display: block; }
  .menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    margin-right: -0.5rem;
    padding: 0.5rem;
    color: var(--heading);
    font-size: 0.95rem;
    cursor: pointer;
    list-style: none;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu .icon { width: 1.25rem; height: 1.25rem; }
  .menu__close, .menu[open] .menu__open { display: none; }
  .menu[open] .menu__close { display: block; }
  .menu__panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.25rem var(--gutter) 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 24px 40px -24px #3c28194d;
  }
  .menu__panel ul { margin: 0; padding: 0; list-style: none; }
  .menu__panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--line);
    color: var(--heading);
    font-family: var(--font-serif);
    font-size: 1.3rem;
    text-decoration: none;
  }
  .menu__panel a[aria-current] { color: var(--link); }
  .menu__panel .btn { width: 100%; margin-top: 1.25rem; font-family: var(--font-sans); font-size: 1rem; color: var(--btn-fg); border-bottom: 1px solid var(--btn-bg); justify-content: center; }
}

@media (max-width: 24rem) {
  .brand__name { display: none; }
  .brand__section { padding-left: 0; border-left: 0; }
}

/* ---------- Decorative shapes (used sparingly) ---------- */

.shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.shapes svg { position: absolute; }
.shapes__dots {
  top: clamp(1.25rem, 3vw, 2.25rem);
  left: clamp(0.75rem, 2.5vw, 2rem);
  width: clamp(4.5rem, 7vw, 6.5rem);
  height: auto;
  fill: var(--c-tan);
  opacity: 0.6;
}
.shapes__corner {
  top: 0;
  right: 0;
  width: clamp(9rem, 26vw, 24rem);
  height: auto;
}
.shapes__a { fill: var(--shape-b); }
.shapes__b { fill: var(--shape-a); }
.shapes__line {
  fill: none;
  stroke: var(--c-caramel);
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
  opacity: 0.6;
}
@media (max-width: 52rem) {
  .shapes__dots { display: none; }
}

/* ---------- Home ---------- */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem) clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}
.hero__inner { position: relative; z-index: 1; }
.hero h1 {
  max-width: 14ch;
  font-size: var(--fs-display);
  line-height: 1.05;
}
.hero .lead { max-width: 38rem; margin-top: 1.25rem; }
.hero .rule { margin-top: 2rem; }
.hero + .section { padding-top: clamp(1rem, 0.5rem + 2vw, 2rem); }

.section { padding-block: var(--space-xl); }
.section--tint {
  border-block: 1px solid var(--line);
  background: var(--surface-tint);
}
.section__head { margin-bottom: var(--space-l); }
.section__head h2 { font-size: var(--fs-h2); }
.section__head p:not(.eyebrow) { max-width: var(--measure); margin-top: 0.75rem; color: var(--muted); }

.app-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-s) var(--space-m);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.app-card__icon { width: 4rem; height: 4rem; }
.app-card__body { min-width: 0; }
.app-card h3 { font-size: clamp(1.45rem, 1.3rem + 0.6vw, 1.8rem); }
.app-card h3 a { color: inherit; text-decoration: none; }
.app-card h3 a:hover { color: var(--link); }
.app-card__platform { margin-top: 0.35rem; color: var(--muted); font-size: var(--fs-small); }
.app-card__desc { max-width: var(--measure); margin-top: 1rem; }
.app-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.app-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
}
.app-card__cta { grid-column: 2; justify-self: start; }
@media (min-width: 64rem) {
  .app-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
  .app-card__cta { grid-column: 3; grid-row: 1; align-self: start; }
}
@media (max-width: 36rem) {
  .app-card { grid-template-columns: minmax(0, 1fr); }
  .app-card__cta { grid-column: 1; }
  .app-card__icon { width: 3.25rem; height: 3.25rem; }
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-m) var(--space-xl);
}
.contact h2 { font-size: var(--fs-h2); }
.contact p:not(.eyebrow) { max-width: 36rem; margin-top: 0.9rem; }
.contact__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  text-align: right;
}
.contact__actions .btn { overflow-wrap: anywhere; }
@media (max-width: 52rem) {
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact__actions { align-items: flex-start; text-align: left; }
}

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

.docs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 clamp(2rem, 1rem + 2.5vw, 3.5rem);
  padding-block: 1.75rem var(--space-xl);
}
.docs__side, .docs__toc { display: none; }

@media (min-width: 60rem) {
  .docs { grid-template-columns: 14.5rem minmax(0, 1fr); padding-top: 2.25rem; }
  .docs__side { display: block; }
  .docs__mobile-nav { display: none; }
}
@media (min-width: 80rem) {
  .docs--toc { grid-template-columns: 14.5rem minmax(0, 1fr) 13rem; }
  .docs--toc .docs__toc { display: block; }
  .docs--toc .toc--inline { display: none; }
}

.docs__side-inner,
.docs__toc-inner {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 1rem;
}
.docs__main { min-width: 0; }

/* Side navigation */
.sidenav .sidenav__app {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  color: var(--heading);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.2;
  text-decoration: none;
}
.sidenav .sidenav__app img { width: 2.25rem; height: 2.25rem; }
.sidenav .sidenav__app:hover { color: var(--link); }
.sidenav__group + .sidenav__group { margin-top: 1.25rem; }
.sidenav__label {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.sidenav ul { margin: 0; padding: 0; list-style: none; }
.sidenav a {
  display: block;
  margin-left: -0.85rem;
  padding: 0.38rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--text);
  font-size: var(--fs-small);
  line-height: 1.4;
  text-decoration: none;
}
.sidenav a:hover { color: var(--heading); border-left-color: var(--line-strong); }
.sidenav a[aria-current="page"] {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--surface-tint), transparent);
  color: var(--heading);
  font-weight: 500;
}
.sidenav .sidenav__back {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-left: 0;
  margin-top: 1.75rem;
  border-left: 0;
  padding-left: 0;
  padding-bottom: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  width: 100%;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-decoration: none;
}
.sidenav .sidenav__back:hover { color: var(--link); }

/* Mobile versions of the side navigation and "On this page" */
.disclosure {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
}
.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0.6rem 1rem;
  color: var(--heading);
  font-size: var(--fs-small);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .icon { transition: transform 0.2s var(--ease); }
.disclosure[open] > summary .icon { transform: rotate(180deg); }
.disclosure__body { padding: 0 1rem 1rem; }
.disclosure .sidenav .sidenav__app { display: none; }
.disclosure .sidenav a { margin-left: 0; }

/* On this page */
.toc__title {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.28rem 0 0.28rem 0.9rem;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
  text-decoration: none;
}
.toc a:hover { color: var(--heading); border-left-color: var(--accent); }
.toc--inline { margin-top: 1.75rem; }
.toc--inline ol { columns: 2 14rem; column-gap: 1.5rem; border-left: 0; }
.toc--inline li { break-inside: avoid; }
.toc--inline a { padding-left: 0; font-size: var(--fs-small); }
.toc--inline a:hover { border-left-color: transparent; }

/* Breadcrumbs */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.breadcrumbs li + li::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--link); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--heading); }

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

.doc-header { margin-bottom: 2rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.doc-header h1 { font-size: var(--fs-h1); line-height: 1.1; }
.doc-header .lead { max-width: var(--measure); margin-top: 1rem; }
.doc-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: var(--fs-small);
}
.doc-header--app { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
.doc-header--app .doc-header__icon { width: 4.5rem; height: 4.5rem; margin-top: 0.35rem; }
@media (max-width: 36rem) {
  .doc-header--app { grid-template-columns: minmax(0, 1fr); }
  .doc-header--app .doc-header__icon { width: 3.25rem; height: 3.25rem; margin: 0 0 1rem; }
}

.prose > * { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1rem; }
.prose > :first-child { margin-top: 0; }
.prose > table, .prose > .table-wrap, .prose > .facts { max-width: none; }

.prose h2 {
  margin-top: 3rem;
  padding-top: 0.25rem;
  font-size: var(--fs-h2);
}
.prose h3 {
  margin-top: 2.25rem;
  font-size: var(--fs-h3);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.prose h2 + *, .prose h3 + * { margin-top: 0.75rem; }
.prose h2 + .card-grid { margin-top: 1.5rem; }
.prose h2:target, .prose h3:target { color: var(--link); }

.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { padding-left: 0.25rem; }
.prose li + li { margin-top: 0.55rem; }
.prose li::marker { color: var(--accent); }
.prose ol > li::marker { font-family: var(--font-serif); font-weight: 500; }
.prose li > ul, .prose li > ol { margin-top: 0.55rem; }
.prose li > p { margin-block: 0.4rem; }
.prose em { font-style: italic; }
.prose li > em:first-child { color: var(--heading); }

.prose code {
  padding: 0.08em 0.35em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--code-bg);
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.prose pre {
  max-width: 100%;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--code-bg);
  line-height: 1.55;
}
.prose pre code { padding: 0; border: 0; background: none; font-size: 0.875rem; overflow-wrap: normal; }

/* Numbered procedure */
.prose ol.steps { counter-reset: step; padding-left: 0; list-style: none; }
.prose ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 3.25rem;
  min-height: 2.25rem;
}
.prose ol.steps > li + li { margin-top: 1.35rem; }
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--link);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1;
}

/* Callouts */
.callout {
  padding: 1.1rem 1.3rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.callout > * + * { margin-top: 0.6rem; }
.callout--muted { border-left-color: var(--line-strong); background: transparent; color: var(--muted); font-size: var(--fs-small); }

/* Key facts */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--line);
}
.facts > div { padding: 1rem 1.2rem; background: var(--surface); }
@media (min-width: 40rem) {
  .facts { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.facts a { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 22rem) {
  .facts a { white-space: normal; overflow-wrap: anywhere; }
}
.facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.facts dd { margin: 0.3rem 0 0; color: var(--heading); }

/* Tables */
.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  font-size: var(--fs-small);
  line-height: 1.55;
}
.prose caption {
  padding-bottom: 0.6rem;
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: left;
}
.prose th, .prose td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th + th, .prose td + td { border-left: 1px solid var(--line); }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose th {
  background: var(--surface-tint);
  color: var(--heading);
  font-weight: 500;
}
.prose td > strong:first-child { display: block; }
.prose td code { white-space: nowrap; }

/* Narrow screens: each row becomes a block, each cell labelled by its column. */
@media (max-width: 44rem) {
  .prose table.stack, .prose .stack thead, .prose .stack tbody, .prose .stack tr, .prose .stack th, .prose .stack td { display: block; }
  .prose table.stack { overflow: visible; border: 0; border-radius: 0; background: none; }
  .prose .stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .prose .stack tr {
    margin-bottom: 1rem;
    padding: 0.35rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
  }
  .prose .stack td { padding: 0.6rem 0; border: 0; }
  .prose .stack td + td { border-left: 0; border-top: 1px solid var(--line); }
  .prose .stack td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }
  .prose td code { white-space: normal; }
}

/* ---------- App overview ---------- */

.prose .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.prose > .card-grid, .prose > .qa-list { max-width: 52rem; }
.prose > .help { margin-top: 0.75rem; }
/* App overview: the help box and pager line up with the wider card grid and question list. */
.docs--app .prose > .help, .docs--app .pager { max-width: 52rem; }
.prose .card-grid > li { margin: 0; padding: 0; }
.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.35rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.doc-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.doc-card:focus-within { border-color: var(--focus); }
.doc-card h3 { margin: 0; font-size: 1.25rem; }
.doc-card h3 a { color: var(--heading); text-decoration: none; }
.doc-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.doc-card h3 a:focus-visible { outline: none; }
.doc-card p { margin-top: 0.5rem; color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.doc-card__kicker {
  margin: 0 0 0.6rem !important;
  color: var(--link) !important;
  font-size: 0.7rem !important;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.prose .qa-list { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.prose .qa-list > li { margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.qa-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  color: var(--heading);
  text-decoration: none;
}
.qa-list a:hover { color: var(--link); }
.qa-list a span { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
@media (max-width: 36rem) {
  .qa-list a { flex-direction: column; gap: 0.1rem; }
}

/* ---------- Help box and pager ---------- */

.help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 2rem;
  max-width: var(--measure);
  margin-top: 3.5rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface-tint);
}
.help h2 { font-size: 1.3rem; }
.help p { margin-top: 0.35rem; color: var(--muted); font-size: var(--fs-small); }
@media (max-width: 40rem) {
  .help { grid-template-columns: minmax(0, 1fr); }
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--measure);
  margin-top: 1.5rem;
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  color: var(--heading);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}
.pager a:hover { border-color: var(--accent); color: var(--link); }
.pager__next { grid-column: 2; text-align: right; }
.pager span {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
@media (max-width: 30rem) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__next { grid-column: 1; }
}

/* ---------- Not found ---------- */

.notfound {
  position: relative;
  isolation: isolate;
  padding-block: clamp(4rem, 2rem + 8vw, 8rem);
}
.notfound .container { position: relative; z-index: 1; }
.notfound h1 { font-size: var(--fs-display); }
.notfound .lead { max-width: 34rem; margin-top: 1.25rem; }
.notfound__links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: var(--fs-small);
}
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-l);
  padding-block: clamp(2.5rem, 1.75rem + 3vw, 3.75rem) 0;
}
.site-footer__brand { display: flex; align-items: center; gap: 1rem; }
.site-footer__logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--heading);
  color: var(--heading);
}
.site-footer__logo .brand__mark { width: 62%; height: auto; }
.site-footer__name { color: var(--heading); font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.2; }
.site-footer__tagline { margin-top: 0.3rem; font-size: 0.7rem; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--link); }
.site-footer__contact { text-align: right; }
.site-footer__label { margin-bottom: 0.35rem; font-size: 0.7rem; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.site-footer__contact a {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
}
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-block: 1.35rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
/* The notice fills the left half of the row; the copyright sits on the right. */
.site-footer__legal { flex: 0 1 50%; max-width: 50%; }
@media (max-width: 52rem) {
  .site-footer__top { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .site-footer__contact { text-align: left; }
  .site-footer__legal { flex-basis: 100%; max-width: none; }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body::before, .skip-link, .site-nav, .menu, .docs__side, .docs__toc, .docs__mobile-nav,
  .toc--inline, .pager, .shapes, .breadcrumbs { display: none !important; }
  .site-header { position: static; border: 0; background: none; backdrop-filter: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .docs { display: block; padding: 0; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .prose table, .prose tr { break-inside: avoid; }
  .site-footer__top { display: none; }
}
