/* Dashboard styles: one calm design language. Every component reads the tokens below only, so the whole theme lives
   in :root. Light is the default; data-theme="dark" forces dark; with no data-theme the system preference decides.
   Mobile first; no horizontal scroll at 320 px. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7fb;              /* the page */
  --surface: #ffffff;         /* cards, sidebar, sheets */
  --surface-2: #fbfbfe;       /* hover, raised bits */
  --surface-3: #eff1f7;       /* the well: sunken bits, meter tracks, code */
  --border: #e7e9f2;          /* hairlines */
  --border-strong: #dcdfeb;   /* input outlines */
  --text: #101321;
  --text-2: #3a3f50;
  --muted: #5b6172;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #ffffff;
  --accent-soft: #eef0ff;
  --accent-soft-text: #4338ca;
  --ok: #15803d;      --ok-solid: #16a34a;   --ok-soft: #e8f7ee;
  --warn: #b45309;    --warn-solid: #d97706; --warn-soft: #fdf3e2;
  --danger: #b91c1c;  --danger-solid: #dc2626; --danger-soft: #fdecec;
  --info: #0369a1;    --info-soft: #e7f4fb;
  --console-bg: #0e101c; --console-text: #d7dbe8; --console-line: #23263a;
  --on-solid: #ffffff;
  --overlay: rgba(13, 15, 23, .5);
  --shadow-1: 0 1px 2px rgba(16, 19, 33, .05), 0 8px 24px rgba(16, 19, 33, .05);
  --shadow-2: 0 2px 6px rgba(16, 19, 33, .07), 0 18px 48px rgba(16, 19, 33, .14);
  --shadow-knob: 0 1px 2px rgba(16, 19, 33, .22);
  --ring: color-mix(in srgb, var(--muted) 45%, transparent);
  --focus: 0 0 0 3px var(--accent-soft);
  --mesh-a: 16%;
  --mesh-b: 9%;
  --warm: #f59e0b;
  /* shape */
  --r-sm: 8px;
  --r: 10px;                  /* buttons, inputs, nav rows */
  --r-lg: 14px;               /* cards */
  --r-modal: 20px;            /* sheets */
  --tap: 38px;
  /* type */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs: 14px;
  --fs-lg: 15px;
  --fs-xl: 22px;
  /* motion */
  --tick: .16s ease-out;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0d0f17;
    --surface: #151827;
    --surface-2: #191d30;
    --surface-3: #10131f;
    --border: #272b40;
    --border-strong: #2f3450;
    --text: #e9eaf3;
    --text-2: #c3c6d6;
    --muted: #9aa0b5;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-text: #14163a;
    --accent-soft: #232748;
    --accent-soft-text: #a5b4fc;
    --ok: #4ade80;      --ok-soft: #12281c;
    --warn: #fbbf24;    --warn-soft: #2b2113;
    --danger: #f87171;  --danger-soft: #2c1519;
    --info: #38bdf8;    --info-soft: #10222f;
    --console-bg: #0a0c15; --console-line: #1e2233;
    --overlay: rgba(0, 0, 0, .62);
    --shadow-1: 0 0 0 1px rgba(39, 43, 64, .55), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-2: 0 0 0 1px rgba(47, 52, 80, .7), 0 20px 56px rgba(0, 0, 0, .55);
    --shadow-knob: 0 1px 2px rgba(0, 0, 0, .5);
    --mesh-a: 11%;
    --mesh-b: 6%;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
    --bg: #0d0f17;
  --surface: #151827;
  --surface-2: #191d30;
  --surface-3: #10131f;
  --border: #272b40;
  --border-strong: #2f3450;
  --text: #e9eaf3;
  --text-2: #c3c6d6;
  --muted: #9aa0b5;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-text: #14163a;
  --accent-soft: #232748;
  --accent-soft-text: #a5b4fc;
  --ok: #4ade80;      --ok-soft: #12281c;
  --warn: #fbbf24;    --warn-soft: #2b2113;
  --danger: #f87171;  --danger-soft: #2c1519;
  --info: #38bdf8;    --info-soft: #10222f;
  --console-bg: #0a0c15; --console-line: #1e2233;
  --overlay: rgba(0, 0, 0, .62);
  --shadow-1: 0 0 0 1px rgba(39, 43, 64, .55), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-2: 0 0 0 1px rgba(47, 52, 80, .7), 0 20px 56px rgba(0, 0, 0, .55);
  --shadow-knob: 0 1px 2px rgba(0, 0, 0, .5);
  --mesh-a: 11%;
  --mesh-b: 6%;
}

/* hoprig.com. The colours, radii, shadows and fonts are the dashboard's own: build.mjs puts the token block of
   web/style.css in front of this file, so the site and the product cannot drift apart. Phone first. */

:root {
  --wrap: 1120px;
  --read: 760px;
  --gutter: 16px;
  /* The dashboard is a dense tool (14 px); a page to read gets a larger step of the same scale. */
  --t-body: 16px;
  --t-small: 14px;
  --t-h1: clamp(30px, 6.4vw, 52px);
  --t-h2: clamp(23px, 3.6vw, 30px);
  --t-h3: 18px;
}
@media (min-width: 720px) { :root { --gutter: 28px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--t-body)/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-soft-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; 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(--border); }
.top-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: none; gap: 4px; margin-left: 18px; }
.nav a, .menu-panel a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; font-size: 15px; padding: 0 11px; border-radius: var(--r); }
.nav a:hover, .menu-panel a:hover { background: var(--surface-3); color: var(--text); }
.nav a[aria-current], .menu-panel a[aria-current] { color: var(--accent-soft-text); background: var(--accent-soft); }
.top-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); border: 0; background: none; color: var(--text-2); cursor: pointer; list-style: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }
.theme-btn .i-moon { display: none; }
.theme-btn[aria-pressed='true'] .i-sun { display: none; }
.theme-btn[aria-pressed='true'] .i-moon { display: block; }
.menu { position: relative; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 50px; min-width: 230px; display: grid; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.menu-panel a { display: flex; padding: 0 12px; font-size: 16px; }
.top-tools > a.icon-btn { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .menu { display: none; }
  .top-tools > a.icon-btn { display: inline-grid; }
}

/* ---------- reading ---------- */
main { min-height: 60vh; }
.page { padding-top: 36px; padding-bottom: 64px; }
.prose { max-width: var(--read); }
/* Pages without a side menu keep their one column in the middle. */
.page > .crumbs, .page > .prose, .page > .page-cta, .page > .pager { margin-left: auto; margin-right: auto; max-width: var(--read); }
.kind-tools .page > .prose, .kind-tools .page > .crumbs { max-width: 1000px; }
.prose > * + * { margin-top: 1em; }
.prose h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
.prose h2 { font-size: var(--t-h2); line-height: 1.25; letter-spacing: -.015em; margin-top: 2em; }
.prose h3 { font-size: var(--t-h3); line-height: 1.35; margin-top: 1.7em; }
.prose h4 { font-size: 16px; margin-top: 1.5em; }
.prose h1 + p { font-size: 18px; color: var(--text-2); }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li > ul, .prose li > ol { margin-top: .35em; }
.prose blockquote { margin: 1em 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r) var(--r) 0; color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose img { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-1); margin: 1.4em auto; }
.prose p[align='center'] { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.prose p[align='center'] img { margin: .6em 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: .08em .35em; }
pre { position: relative; margin: 1.2em 0; padding: 14px 16px; background: var(--console-bg); color: var(--console-text); border-radius: var(--r-lg); overflow-x: auto; line-height: 1.55; font-size: 14px; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
pre code.language-markdown { white-space: pre-wrap; }
pre.has-copy { padding-top: 56px; }
.table { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.kind-tools td code { white-space: normal; }

/* ---------- buttons, install line ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r); font-weight: 600; text-decoration: none; border: 1px solid transparent; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-quiet:hover { background: var(--surface-2); }
.install { display: flex; align-items: stretch; max-width: 880px; background: var(--console-bg); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.install code { flex: 1; min-width: 0; display: block; padding: 15px 16px; overflow-x: auto; white-space: nowrap; background: none; border: 0; border-radius: 0; color: var(--console-text); font-size: 14px; line-height: 1.5; }
.install code::before { content: '$ '; color: #8b91a8; }
.copy { flex: none; border: 0; cursor: pointer; font: 600 14px var(--font); padding: 0 18px; min-height: 48px; background: var(--accent); color: var(--accent-text); }
.copy:hover { background: var(--accent-hover); }
.copy.done { background: var(--ok-solid); color: #fff; }
.pre-copy { position: absolute; top: 8px; right: 8px; min-height: 40px; min-width: 64px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; background: #2a2e45; color: var(--console-text); }
.pre-copy:hover { background: #363b58; }

/* ---------- home ---------- */
.hero { padding: 44px 0 20px; text-align: center; background:
  radial-gradient(900px 380px at 15% -10%, color-mix(in srgb, var(--accent) var(--mesh-a), transparent), transparent 70%),
  radial-gradient(700px 320px at 95% 0%, color-mix(in srgb, #10b981 var(--mesh-b), transparent), transparent 70%); }
.kicker { display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; }
.hero h1 { font-size: var(--t-h1); line-height: 1.08; letter-spacing: -.03em; margin: 0 auto; max-width: 15em; }
.hero .lead { font-size: clamp(17px, 2.4vw, 21px); color: var(--text-2); max-width: 36em; margin: 18px auto 28px; line-height: 1.5; }
.hero .install { margin: 0 auto; text-align: left; }
.hero .under { font-size: 14px; color: var(--muted); margin: 12px auto 0; max-width: 40em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.hero-shot { margin: 40px auto 0; max-width: 1040px; }
.hero-shot img { border-radius: var(--r-modal); box-shadow: var(--shadow-2); border: 1px solid var(--border); }
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { font-size: var(--t-h2); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.section .intro { color: var(--text-2); max-width: 46em; margin: 0 0 28px; font-size: 17px; }
.kind-home .wrap.prose { max-width: var(--wrap); }
.kind-home .prose > h2:first-child { margin-top: 0; }
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 22px !important; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } .cards.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.section-alt .card { background: var(--bg); }
.card > * + * { margin-top: .6em; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.card p { margin: .5em 0 0; color: var(--text-2); font-size: 15.5px; }
.card .num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color var(--tick), transform var(--tick); }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
a.card h3 { color: var(--text); }
.card .who { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); vertical-align: middle; }
.shots { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 26px !important; }
@media (min-width: 900px) { .shots { grid-template-columns: repeat(3, 1fr); } }
.shot figure, figure.shot { margin: 0; }
.shots img { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-1); margin: 0; }
.shots figcaption, .shots p { font-size: 14.5px; color: var(--text-2); margin-top: 10px; }
.steps ol { counter-reset: step; display: grid; gap: 16px; grid-template-columns: 1fr; padding: 0; list-style: none; margin: 22px 0 28px; }
@media (min-width: 900px) { .steps ol { grid-template-columns: repeat(3, 1fr); } }
.steps ol > li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 20px 20px 64px; position: relative; margin: 0 !important; }
.steps ol > li::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; border-radius: 99px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.faq h3 { font-size: 18px; margin-top: 1.6em; }
.faq h3 + p { margin-top: .4em; color: var(--text-2); }
.cta { text-align: center; }
.cta .install { margin: 18px auto 0; text-align: left; }

/* ---------- use cases, docs ---------- */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--muted); }
.answer { font-size: 18px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-lg); padding: 16px 18px; }
.pager { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 48px; max-width: var(--read); }
@media (min-width: 720px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--text); }
.pager a span { display: block; font-size: 13px; color: var(--muted); }
.pager a.next { text-align: right; }
.page-cta { max-width: var(--read); margin-top: 40px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.page-cta h2 { margin: 0 0 12px; font-size: 20px; }
.docs-layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .docs-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 48px; } }
.side { font-size: 15px; }
.side details { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.side summary { cursor: pointer; padding: 12px 14px; min-height: 44px; font-weight: 600; }
.side nav { display: grid; }
.side details nav { padding: 0 8px 10px; }
.side nav a { display: flex; align-items: center; min-height: 40px; padding: 4px 10px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; line-height: 1.35; }
.side nav a:hover { background: var(--surface-3); }
.side nav a[aria-current] { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600; }
.side .group { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 10px 4px; font-weight: 600; }
.side-wide { display: none !important; }
@media (min-width: 1000px) {
  .side-wide { display: grid !important; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
  .side-narrow { display: none; }
}
.doclist { display: grid; gap: 12px; grid-template-columns: 1fr; padding: 0 !important; list-style: none; }
@media (min-width: 720px) { .doclist { grid-template-columns: 1fr 1fr; } }
.doclist li { margin: 0 !important; }
.doclist a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--text); }
.doclist a strong { display: block; }
.doclist a span { display: block; margin-top: 4px; color: var(--text-2); font-size: 14.5px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0 28px; margin-top: 24px; font-size: 15px; }
.foot-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot nav { display: grid; gap: 0; align-content: start; }
.foot nav a { display: flex; align-items: center; min-height: 40px; color: var(--text-2); text-decoration: none; }
.foot nav a:hover { color: var(--text); text-decoration: underline; }
.foot .brand { margin-bottom: 8px; }
.foot-note { margin-top: 26px; color: var(--muted); font-size: 13.5px; }
.foot-note > p:first-child { border-top: 1px solid var(--border); padding-top: 18px; }
.foot-note p { margin: 0 0 6px; }
.foot-note a { color: var(--muted); display: inline-block; min-height: 40px; line-height: 40px; }
.foot-note p:first-child { line-height: 40px; }

/* A table of four or more columns is one card per row on a phone: the row's first cell as its title, then each
   answer under its column's name (data-label, set by the build). */
@media (max-width: 720px) {
  .table-wide { overflow: visible; border: 0; background: none; }
  .table-wide table, .table-wide tbody, .table-wide tr, .table-wide td { display: block; width: 100%; }
  .table-wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wide tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 12px; padding: 4px 0; }
  .table-wide td { border: 0; padding: 6px 14px; }
  .table-wide td:first-child { font-weight: 650; font-size: 16px; padding-top: 10px; }
  .table-wide td[data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table-wide td code { white-space: normal; }
}
.al-center { text-align: center; }
.al-right { text-align: right; }
.cta-note { margin-top: 12px; }

/* A screenshot is a link to its full-size file, with a hint under it. */
a.shot-link { display: block; color: var(--text-2); text-decoration: none; }
p[align='center'] > a.shot-link { display: inline-block; }
.prose a.shot-link img { margin-bottom: .4em; }
.shots a.shot-link img { margin: 0 0 .4em; }
.enlarge { display: flex; align-items: center; justify-content: center; min-height: 40px; font-size: 13.5px; color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a.shot-link:hover .enlarge { color: var(--text); }
.on-wide { display: none; }
@media (min-width: 720px) { .on-narrow { display: none; } .on-wide { display: inline; } }
@media (max-width: 480px) { .kicker { font-size: 13px; } }
.kind-list .page > .prose { max-width: var(--wrap); }
