/* Robot Designer website. One stylesheet for every page; colours come from the app's icon. */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-code: #f1f3f6;
  --text: #1d2330;
  --text-soft: #545d6e;
  --line: #e2e5ea;
  --accent: #e8701a;
  --accent-soft: #fdf0e6;
  --slate: #2a303c;
  --link: #c45a0c;
  --ok: #2f9e5b;
  --shadow: 0 1px 2px rgba(20, 25, 35, .06), 0 8px 24px rgba(20, 25, 35, .08);
  --radius: 10px;
  --header-h: 60px;
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #15181e;
  --bg-soft: #1c2028;
  --bg-code: #222731;
  --text: #e6e8ec;
  --text-soft: #a3abb8;
  --line: #2c323d;
  --accent: #f4862e;
  --accent-soft: #2d221a;
  --slate: #0f1115;
  --link: #f79a4f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 2.3rem; margin-top: 0; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }
code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-code);
  padding: .12em .38em;
  border-radius: 5px;
}
kbd {
  font-family: var(--mono);
  font-size: .82em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .05em .4em;
  background: var(--bg-soft);
}
pre {
  position: relative;
  background: var(--slate);
  color: #e8eaee;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font: 600 .75rem var(--font);
  color: #cfd4dc; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15); border-radius: 6px;
  padding: 3px 9px; cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, .16); }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .94rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; background: var(--bg-soft); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  color: var(--text-soft); font-weight: 550; font-size: .95rem;
  padding: 6px 12px; border-radius: 7px;
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.main-nav a.active { color: var(--text); background: var(--bg-soft); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.search-btn, .icon-btn {
  display: flex; align-items: center; gap: 8px;
  font: 500 .88rem var(--font); color: var(--text-soft);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
.search-btn { min-width: 170px; }
.search-btn kbd { margin-left: auto; }
.search-btn:hover, .icon-btn:hover { color: var(--text); }
.menu-btn { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 36px 0; color: var(--text-soft); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .98rem;
  padding: 11px 20px; border-radius: 9px;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--bg); }

/* Home */
.hero { padding: 72px 0 40px; text-align: center; }
.hero .eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 650; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 99px;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); max-width: 860px; margin: 0 auto 18px; letter-spacing: -.025em; }
.hero p.lead { font-size: 1.2rem; color: var(--text-soft); max-width: 720px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-shot { margin: 48px auto 0; max-width: 1100px; }
.shot {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); background: #1e1e1e; cursor: zoom-in;
}
.shot img { width: 100%; height: auto; }
figure { margin: 0 0 1.5em; }
figcaption { font-size: .88rem; color: var(--text-soft); margin-top: 10px; text-align: center; }

.section { padding: 64px 0 8px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head h2 { font-size: 2rem; margin: 0 0 10px; }
.section-head p { color: var(--text-soft); font-size: 1.08rem; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: block; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card .thumb { border-radius: 7px; overflow: hidden; margin: -6px -6px 14px; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: #1e1e1e; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--text-soft); font-size: .94rem; }
.card .more { display: inline-block; margin-top: 10px; font-size: .9rem; font-weight: 600; color: var(--link); }

.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.steps > div {
  counter-increment: step; position: relative; padding: 18px 18px 18px 58px;
  background: var(--bg-soft); border-radius: var(--radius);
}
.steps > div::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem;
}
.steps h4 { margin: 2px 0 4px; font-size: 1rem; }
.steps p { margin: 0; font-size: .92rem; color: var(--text-soft); }

.split { display: grid; grid-template-columns: 1fr 1.35fr; gap: 44px; align-items: center; padding: 36px 0; }
.split.flip { grid-template-columns: 1.35fr 1fr; }
.split.flip > :first-child { order: 2; }
.split h2 { margin-top: 0; }
.split ul { padding-left: 1.2em; }

.cta {
  margin: 72px 0 0; padding: 44px; border-radius: 16px; text-align: center;
  background: var(--slate); color: #f1f2f4;
}
.cta h2 { margin: 0 0 10px; color: #fff; }
.cta p { color: #b9c0cc; margin-bottom: 22px; }

/* Feature pages */
.page-hero { padding: 52px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.page-hero .crumbs { font-size: .88rem; color: var(--text-soft); margin-bottom: 10px; }
.page-hero p.lead { font-size: 1.15rem; color: var(--text-soft); max-width: 760px; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 24px 0; }
.feature-list > div { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; }
.feature-list h4 { margin: 0 0 4px; font-size: .98rem; }
.feature-list p { margin: 0; font-size: .92rem; color: var(--text-soft); }
.next-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.next-links a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; max-width: 48%; }
.next-links a:hover { border-color: var(--accent); text-decoration: none; }
.next-links small { display: block; color: var(--text-soft); font-size: .8rem; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 210px; gap: 40px; padding-top: 32px; }
.docs-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; font-size: .92rem; }
.docs-nav h5 { margin: 18px 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.docs-nav h5:first-child { margin-top: 0; }
.docs-nav a { display: block; color: var(--text-soft); padding: 4px 10px; border-radius: 6px; }
.docs-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.docs-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.docs-content { min-width: 0; }
.docs-content > h1 { margin-bottom: .3em; }
.docs-content > .lead { font-size: 1.12rem; color: var(--text-soft); }
.docs-content h2 { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 2em; }
.docs-content h2 + h3 { margin-top: .8em; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: .85rem; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.toc h5 { margin: 0 0 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.toc a { display: block; color: var(--text-soft); padding: 3px 0 3px 10px; border-left: 2px solid var(--line); }
.toc a.sub { padding-left: 22px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.heading-anchor { opacity: 0; margin-left: 8px; font-weight: 400; color: var(--text-soft); }
h2:hover .heading-anchor, h3:hover .heading-anchor { opacity: 1; }

.note, .tip, .warn {
  padding: 12px 16px; border-radius: 9px; margin: 0 0 1.2em; font-size: .95rem;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.note::before, .tip::before, .warn::before { font-weight: 700; margin-right: 6px; }
.note::before { content: "Note"; }
.tip { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.tip::before { content: "Tip"; color: var(--ok); }
.warn { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.warn::before { content: "Important"; color: var(--accent); }
.note p:last-child, .tip p:last-child, .warn p:last-child { margin: 0; }

/* Sub-tab switcher: a tab strip over panels, used where a page shows several sub-tabs. */
.tabs { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1.5em; overflow: hidden; }
.tab-strip { display: flex; flex-wrap: wrap; gap: 2px; background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 6px 6px 0; }
.tab-strip button {
  font: 600 .9rem var(--font); color: var(--text-soft); background: none; border: 0;
  padding: 8px 14px; border-radius: 7px 7px 0 0; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab-strip button:hover { color: var(--text); }
.tab-strip button[aria-selected="true"] { color: var(--accent); background: var(--bg); border-bottom-color: var(--accent); }
.tab-panel { padding: 18px 20px 4px; }
.tab-panel[hidden] { display: none; }
.tab-panel .shot { margin-bottom: 14px; }

/* Install page OS switcher reuses .tabs; .os-only hides text for the other system. */

/* Search */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 16, .5);
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.search-overlay.open { display: flex; }
.search-box { width: min(620px, 92vw); background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.search-box input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: none;
  font: 1.05rem var(--font); padding: 16px 18px; background: var(--bg); color: var(--text);
}
.search-results { max-height: 55vh; overflow-y: auto; }
.search-results a { display: block; padding: 11px 18px; color: var(--text); border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results small { display: block; color: var(--text-soft); font-size: .84rem; }
.search-results .empty { padding: 18px; color: var(--text-soft); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(8, 10, 14, .88);
  display: none; align-items: center; justify-content: center; padding: 3vw; cursor: zoom-out;
}
.lightbox.open { display: flex; flex-direction: column; gap: 12px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox p { color: #d6dae1; margin: 0; font-size: .95rem; }

/* Narrow screens */
@media (max-width: 1100px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .menu-btn { display: flex; }
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px;
  }
  .main-nav.open { display: flex; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 0; }
  .next-links { flex-direction: column; }
  .next-links a { max-width: none; }
}

/* Charts (assets/charts.js). One accent for the mark that matters, a neutral for the rest. */
:root { --chart-accent: #e8701a; --chart-muted: #7c8595; --chart-grid: #e6e8ec; }
:root[data-theme="dark"] { --chart-accent: #d9651a; --chart-muted: #6b7483; --chart-grid: #2c323d; }
figure.chart { align-self: start; margin: 0 0 1.4em; padding: 16px 18px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
figure.chart figcaption { text-align: left; margin: 0 0 8px; color: var(--text); font-weight: 600; font-size: .95rem; }
figure.chart figcaption small { display: block; font-weight: 400; color: var(--text-soft); }
.chart-plot svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart-plot .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-plot .ref { stroke: var(--text-soft); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-plot .mark { fill: var(--chart-muted); }
.chart-plot .mark.accent { fill: var(--chart-accent); }
.chart-plot .mark:hover { opacity: .85; }
.chart-plot .series { fill: none; stroke: var(--chart-accent); stroke-width: 2; }
.chart-plot .cross { stroke: var(--text-soft); stroke-width: 1; }
.chart-plot .dot { fill: var(--chart-accent); stroke: var(--bg); stroke-width: 2; }
.chart-plot .label { fill: var(--text); font-size: 13px; }
.chart-plot .value { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart-plot .tick, .chart-plot .axis { fill: var(--text-soft); font-size: 11.5px; }
figure.chart details { margin-top: 6px; font-size: .88rem; }
figure.chart summary { cursor: pointer; color: var(--text-soft); }
figure.chart details table { margin: 8px 0 4px; }
.chart-tip {
  position: fixed; z-index: 130; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--slate); color: #f1f2f4; font-size: .82rem; padding: 6px 9px; border-radius: 6px;
  box-shadow: var(--shadow); max-width: 320px;
}
.chart-tip.on { opacity: 1; }

/* Analysis cards: question, findings, chart, decision, side by side on wide screens. */
.analysis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; padding: 32px 0; border-top: 1px solid var(--line); }
.analysis h2 { margin: 0 0 6px; font-size: 1.35rem; padding: 0; border: 0; }
.analysis .source { font-size: .85rem; color: var(--text-soft); margin-bottom: 12px; }
.analysis .question { font-size: 1.02rem; margin-bottom: 12px; }
.analysis ul { padding-left: 1.1em; margin-bottom: 14px; }
.decision { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: .95rem; }
.decision strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 2px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0 0 14px; }
.stat { background: var(--bg-soft); border-radius: 9px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.2; }
.stat span { font-size: .82rem; color: var(--text-soft); }
@media (max-width: 900px) { .analysis { grid-template-columns: 1fr; } }
