/* XM-Five Studio — support site */
:root {
  --bg: #ffffff;
  --surface: #f4f4f2;
  --ink: #141414;
  --ink-soft: #4a4a48;
  --line: #dcdcd8;
  --accent: #8a6a2f;
  --accent-ink: #ffffff;
  --focus: #1f5fd1;
  --error: #a3241b;
  --font: "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 30; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 18px; letter-spacing: 0.01em; text-decoration: none; }
.site-nav { display: flex; gap: clamp(14px, 3vw, 28px); flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-size: 15px; padding: 10px 0; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1.5px; }

/* Type */
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0; text-wrap: pretty; }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 58ch; }
.muted { color: var(--ink-soft); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface); padding: 2px 6px; border-radius: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); border-radius: var(--radius);
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 140ms var(--ease);
}
.btn:hover { background: var(--bg); color: var(--ink); }
.btn:active { transform: scale(0.98); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
.hero { padding-block: clamp(56px, 10vw, 120px) clamp(48px, 8vw, 96px); }
.hero > .wrap { display: grid; gap: 24px; }
.band { padding-block: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); }
.band--tint { background: var(--surface); }
.stack { display: grid; gap: 16px; align-content: start; }
.stack-lg { display: grid; gap: 32px; }

.split { display: grid; gap: clamp(24px, 5vw, 64px); grid-template-columns: minmax(0, 1fr); }
.split > * { align-self: start; }
@media (min-width: 800px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: grid; gap: 4px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .rows li { grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); } }
.rows strong { font-weight: 600; }

.presets { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.preset { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.preset__swatch { display: flex; height: 72px; }
.preset__swatch span { flex: 1; }
.preset__body { padding: 16px; display: grid; gap: 6px; }

/* Docs layout */
.docs-head { padding-block: clamp(32px, 6vw, 64px) 0; }
.docs { display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: minmax(0, 1fr); padding-block: 32px 96px; }
.toc { border-block: 1px solid var(--line); padding-block: 16px; }
.toc ol { columns: 2; column-gap: 24px; }
@media (min-width: 900px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; border: 0; padding: 0; }
  .toc ol { columns: 1; }
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 0; font-size: 15px; text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--ink); }
.toc__title { font-weight: 600; margin-bottom: 8px; }
.prose { max-width: 72ch; }
.prose section { padding-top: 40px; display: grid; gap: 14px; }
.docs .prose section:first-of-type { padding-top: 0; }
.prose h3 { margin-top: 12px; }
.prose ol, .prose ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }

/* Form */
.form { display: grid; gap: 20px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 15.5px; }
.field .hint { font-size: 14.5px; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid #8f8f8a; border-radius: var(--radius); padding: 12px 14px; min-height: 48px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input[type="file"] { padding: 10px; }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--error); }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; font-size: 15px; color: var(--ink-soft); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

.page { padding-block: clamp(40px, 7vw, 80px) 96px; }
.page .prose section:first-of-type { padding-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:active { transform: none; }
}
