/* spinto.dev: flat, ruled, square. Light and dark follow prefers-color-scheme. */

:root {
  color-scheme: light dark;
  --bg: #fdfdfc;
  --fg: #1b1b18;
  --body: #3d3d38;
  --muted: #55554f;
  --faint: #6f6f69;
  --line: #e4e4e0;
  --line-strong: #a8a8a1;
  --card: #f7f7f5;
  --accent: #0369a1;
  --alert: #b91c1c;
  --code-string: #2b6a3f;
  --code-number: #8a4b0b;
  --mark: rgb(27 27 24 / 0.07);
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --column: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --edge: clamp(20px, 3vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0a;
    --fg: #ededec;
    --body: #c9c9c5;
    --muted: #a3a3a0;
    --faint: #8a8a86;
    --line: #262624;
    --line-strong: #4a4a46;
    --card: #141413;
    --accent: #38bdf8;
    --alert: #f87171;
    --code-string: #8fcf9f;
    --code-number: #e0b070;
    --mark: rgb(237 237 236 / 0.1);
    --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { text-wrap: balance; }

code, kbd, pre { font-family: var(--mono); font-variant-ligatures: none; }

:not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.875em;
}

figure { margin: 0; }

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

.skip {
  position: absolute;
  top: 8px;
  left: -999px;
  z-index: 10;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
}
.skip:focus { left: 8px; }

/* Labels */

.eyebrow {
  margin: 0 0 16px;
  color: var(--faint);
  font: 400 12px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
}
.button:hover { border-color: var(--line-strong); }
.button.primary { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.button.primary:hover { opacity: 0.86; }
.button.small { min-height: 40px; padding: 0 16px; font-size: 15px; }

/* Page column: the home and tour pages sit in a 1200px column with hairline sides. */

.page {
  max-width: var(--column);
  margin: 0 auto;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.page { display: flex; flex-direction: column; min-height: 100vh; }
.page > main { flex: 1 0 auto; min-width: 0; }

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px var(--edge);
  border-bottom: 1px solid var(--line);
}
.page > .site-header { padding-right: var(--gutter); padding-left: var(--gutter); }

.site-header .left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg { width: 24px; height: 24px; }
.brand svg .ink { stroke: var(--fg); }
.brand svg .fill { fill: var(--fg); }

.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 500; }

@media (max-width: 560px) {
  .site-header .button { display: none; }
  .nav { gap: 20px; }
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px var(--edge) 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}
.page > .site-footer { padding-right: var(--gutter); padding-left: var(--gutter); }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--fg); }

/* Frames and figures */

.frame { border: 1px solid var(--line); background: var(--card); }
.frame img { width: 100%; }
.frame video { display: block; width: 100%; height: auto; }
/* The hero plays the clip on wider screens and shows a phone still below 640 px. */
.frame .narrow-only { display: none; }
@media (max-width: 640px) {
  .frame .wide-only, .frame .speed[hidden] { display: none; }
.speed { display: none; }
  .frame .narrow-only { display: block; }
}

/* Phones: previews are cropped for a phone, not shrunk from a desktop, and sit in rounded frames. */
@media (max-width: 640px) {
  .frame, .thumb { border-radius: 12px; overflow: hidden; }
  .clip .thumb, figure[data-clip="checks"] .thumb { aspect-ratio: 584 / 1080; max-width: 380px; margin-right: auto; margin-left: auto; }
  /* The MCP Inspector has no phone cut: show its left part, larger. */
  .clip .thumb.crop { aspect-ratio: 1; max-width: none; }
  .clip .thumb.crop video, .clip .thumb.crop img { object-fit: cover; object-position: 12% 0; }
  .teasers .thumb { aspect-ratio: 4 / 3; }
  .teasers .thumb img { object-fit: cover; object-position: top center; }
}

/* A screenshot that only exists in light mode is dimmed a little on a dark page. */
@media (prefers-color-scheme: dark) { .light-only { filter: brightness(0.85); } }

.caption { margin-top: 12px; color: var(--faint); font-size: 14px; }

.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 12px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media { position: relative; }

.speed {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 2px 8px;
  background: var(--fg);
  color: var(--bg);
  font: 12px/1.5 var(--mono);
}

/* Code blocks and logs */

.code { margin: 0; border: 1px solid var(--line); background: var(--card); min-width: 0; }

.code-file {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 12px/1.6 var(--mono);
  overflow-wrap: anywhere;
}
.code-file a { color: inherit; }
.code-file a:hover { color: var(--fg); }

.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: var(--fg);
  font-size: 12px;
  line-height: 1.75;
}

.code .k { font-weight: 500; }
.code .s { color: var(--code-string); }
.code .a { color: var(--code-number); }
.code .t { color: var(--fg); }
.code .c { color: var(--faint); }
.code mark { padding: 0 2px; background: var(--mark); color: inherit; }

.log pre { display: grid; gap: 2px; }
.log .row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; white-space: nowrap; }
.log time, .log .when { color: var(--faint); }
.log .kill { color: var(--alert); }

/* Home: hero */

.hero { padding: clamp(72px, 11vw, 152px) var(--gutter) 56px; }
.hero .eyebrow { margin-bottom: 28px; }

.hero h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.lead { display: grid; gap: 20px; max-width: 600px; margin-top: 40px; color: var(--muted); font-size: 17px; }
.lead p { margin: 0; }

.hero-shot { padding: 0 var(--gutter) clamp(64px, 8vw, 104px); }

/* Home: sections */

.section { padding: clamp(64px, 8vw, 104px) var(--gutter); border-top: 1px solid var(--line); }

.section h2, .closing h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.copy { max-width: 40rem; }
.copy > p:not(.eyebrow) { margin: 16px 0 0; color: var(--muted); }
.copy > h2 + p { margin-top: 20px; }
.copy .more { margin-top: 24px; }

.split { display: grid; gap: 48px 64px; align-items: start; }
.split > * { min-width: 0; }
.stack { display: grid; gap: 16px; min-width: 0; }

@media (min-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split.media-wide { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .split .narrow { justify-self: end; }
}
.split .narrow { width: 100%; max-width: 460px; }

/* Home: facts list */

.facts { margin: 32px 0 0; border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  gap: 4px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 560px) { .facts > div { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); } }
.facts dt { font-weight: 500; }
.facts dd { margin: 0; color: var(--muted); }

/* Home: MCP tool names */

.tool-groups { display: grid; gap: 28px; }
.tool-groups .eyebrow { margin-bottom: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tools li {
  padding: 5px 10px;
  border: 1px solid var(--line);
  font: 13px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

/* Home: tour teaser */

.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; }
.section-head > a { color: var(--fg); font-weight: 500; }

.teasers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 32px 24px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.teasers a { display: block; color: var(--fg); text-decoration: none; }
.teasers a:hover .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.thumb { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; }
.thumb.cover img, .thumb.cover video { object-fit: cover; object-position: top left; }

.label { display: flex; gap: 12px; margin-top: 12px; }
.label .n { padding-top: 2px; color: var(--faint); font: 12px/1.6 var(--mono); }
.label .title { font-weight: 500; }

/* Home: closing */

.closing { padding: clamp(80px, 10vw, 128px) var(--gutter); border-top: 1px solid var(--line); }
.closing p { max-width: 520px; margin: 16px 0 0; color: var(--muted); }
.closing .actions { margin-top: 32px; }

/* Tour */

.page-intro { padding: clamp(64px, 9vw, 120px) var(--gutter) 48px; }
.page-intro .eyebrow { margin-bottom: 20px; }
.page-intro h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.page-intro p:not(.eyebrow) { max-width: 600px; margin: 24px 0 0; color: var(--muted); font-size: 17px; }
.page-intro p.note { margin-top: 16px; color: var(--faint); font-size: 15px; }

.clips { display: grid; border-top: 1px solid var(--line); }
.clip { padding: clamp(20px, 3vw, 40px); border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
@media (min-width: 1000px) {
  .clips { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .clips > .clip:nth-child(odd) { border-right: 1px solid var(--line); }
}
.clip figcaption { display: flex; gap: 16px; margin-top: 16px; }
.clip figcaption .n { padding-top: 3px; color: var(--faint); font: 12px/1.6 var(--mono); }
.clip figcaption .title { display: block; font-weight: 500; }
.clip figcaption .text { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }

.play {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: fit-content;
  height: fit-content;
  margin: auto;
  padding: 8px 16px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font: 500 15px/1.5 var(--sans);
  cursor: pointer;
}
.play::before { content: "\25B6\FE0E"; margin-right: 8px; font-size: 12px; }
.play:hover { opacity: 0.86; }

/* Docs */

.docs-shell { display: grid; }
@media (min-width: 960px) { .docs-shell { grid-template-columns: 264px minmax(0, 1fr); } }

.docs-nav { padding: 0 var(--edge); border-bottom: 1px solid var(--line); font-size: 15px; }
.docs-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
}
.docs-nav summary::-webkit-details-marker { display: none; }
.docs-nav summary .eyebrow { margin: 0; }
.docs-nav summary::after { content: "+"; color: var(--faint); font: 16px var(--mono); }
.docs-nav details[open] summary::after { content: "\2212"; }
.docs-nav details[open] { padding-bottom: 24px; }
.docs-nav details[open] summary { margin-bottom: 8px; }

@media (min-width: 960px) {
  .docs-nav { padding: 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .docs-nav details, .docs-nav details[open] {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 32px 24px 64px var(--edge);
  }
  .docs-nav summary { display: none; }
}

.docs-group + .docs-group { margin-top: 28px; }
.docs-group .eyebrow { margin: 0; font-size: 11px; }
.docs-group ul,
.toc ul { margin: 10px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.docs-group a,
.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.docs-group a:hover,
.toc a:hover { color: var(--fg); }
.docs-group a[aria-current="page"] { border-left-color: var(--fg); color: var(--fg); font-weight: 500; }
.toc a.is-current { border-left-color: var(--fg); color: var(--fg); }

.docs-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  padding: clamp(40px, 5vw, 56px) clamp(20px, 5vw, 72px) 96px;
}
.toc { display: none; font-size: 14px; }
.toc .eyebrow { margin: 0; font-size: 11px; }

@media (min-width: 1200px) {
  .docs-main { grid-template-columns: minmax(0, 720px) 200px; justify-content: space-between; }
  .toc:not([hidden]) { display: block; position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; }
  .has-toc .doc-toc { display: none; }
}

/* Docs: prose */

.prose { min-width: 0; max-width: 720px; }
.prose .eyebrow { margin-bottom: 12px; }
.prose h1 { margin: 0; font-size: clamp(34px, 5vw, 44px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.prose .source { margin: 16px 0 0; color: var(--faint); font-size: 14px; }
.prose .source a { color: inherit; }
.prose .source code { padding: 0; border: 0; background: none; font-size: 13px; }

.notice { display: flex; gap: 16px; margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line); background: var(--card); }
.notice::before { content: ""; flex: none; width: 3px; background: var(--fg); }
.notice p { margin: 0; color: var(--body); font-size: 15px; }
.notice strong { color: var(--fg); font-weight: 600; }

.doc-body { color: var(--body); }
.doc-body > :first-child { margin-top: 40px; }
.doc-body h2 { margin: 56px 0 0; color: var(--fg); font-size: 26px; font-weight: 500; line-height: 1.25; letter-spacing: -0.02em; scroll-margin-top: 24px; }
.doc-body h3 { margin: 36px 0 0; color: var(--fg); font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; scroll-margin-top: 24px; }
.doc-body p, .doc-body ul, .doc-body ol { margin: 16px 0 0; }
.doc-body ul, .doc-body ol { padding-left: 1.25em; }
.doc-body li + li, .doc-body li > ul { margin-top: 6px; }
.doc-body li::marker { color: var(--faint); }
.doc-body strong { color: var(--fg); font-weight: 600; }
.doc-body :not(pre) > code { font-size: 0.875em; overflow-wrap: anywhere; }
.doc-body a[name] { scroll-margin-top: 24px; }

/* The docs put each <a name> anchor in its own paragraph before a heading. The heading's
   space moves above the anchor, so following a link lands on the heading. */
.doc-body p:has(> a[name]:only-child:empty) { margin: 0; }
.doc-body p:has(> a[name]:only-child:empty):has(+ h2) { margin-top: 56px; }
.doc-body p:has(> a[name]:only-child:empty):has(+ h3) { margin-top: 36px; }
.doc-body p:has(> a[name]:only-child:empty) + :is(h2, h3) { margin-top: 0; }

.doc-body div.highlighter-rouge { margin-top: 20px; border: 1px solid var(--line); background: var(--card); }
.doc-body pre { margin: 0; padding: 18px 16px; overflow-x: auto; color: var(--fg); font-size: 13px; line-height: 1.75; }

.doc-body .table { margin-top: 20px; overflow-x: auto; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-body th { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--fg); color: var(--fg); font-weight: 600; text-align: left; vertical-align: bottom; }
.doc-body td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-body :is(td, th) code { overflow-wrap: break-word; }
.doc-body th:last-child, .doc-body td:last-child { padding-right: 0; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; }
.pager a { color: var(--fg); text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager span { display: block; color: var(--faint); font-size: 13px; }
.pager .next { margin-left: auto; text-align: right; }

/* Rouge token colors, flat: strings and numbers get a tint, keywords get weight. */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kw, .highlight .kp { font-weight: 500; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sh, .highlight .dl { color: var(--code-string); }
.highlight .se, .highlight .si { color: var(--code-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il, .highlight .kc, .highlight .nb, .highlight .cp, .highlight .na, .highlight .nl { color: var(--code-number); }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cd, .highlight .cs, .highlight .ch, .highlight .gp { color: var(--faint); }
.highlight .p, .highlight .o { color: var(--muted); }

/* 404 */

.notfound { padding: clamp(80px, 14vw, 160px) var(--gutter); }
.notfound h1 { margin: 0; font-size: clamp(36px, 5vw, 56px); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; }
.notfound p:not(.eyebrow) { max-width: 520px; margin: 20px 0 0; color: var(--muted); font-size: 17px; }

/* Motion: nothing on this site animates when the reader asks for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
