/*
  brinkbar.com — one stylesheet for every page.

  Colors are the branded token set from the Brink brand guide
  (brink/Docs/Branding/brink-branding.html, v2.0.2, "Themes" › Web / docs):
  the dark set on :root, the light set under prefers-color-scheme: light.
  Headings use the wordmark faces (Bricolage Grotesque, JetBrains Mono, loaded
  from Google Fonts in each page's <head>); body text uses the system font.
*/

:root {
  color-scheme: dark light;
  --bg: #0B0910;
  --surface-1: #14111E;
  --surface-2: #0E0C16;
  --text: #F4F2F9;
  --text-muted: #A69FBC;
  --accent: #8B5CF6;
  --accent-text: #B79BFF;
  --btn: #7C4DFF;
  --btn-hover: #6B39F0;
  --link: #9E9EFF;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --code-bg: rgba(255, 255, 255, 0.06);
  --edge: linear-gradient(180deg, #8B5CF6, #B23BC9);

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-code: ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --page: 1040px;
  --prose: 720px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FBFAFD;
    --surface-1: #FFFFFF;
    --surface-2: #F1EEF7;
    --text: #1C1730;
    --text-muted: #5E5279;
    --accent: #7C4DFF;
    --accent-text: #6B39F0;
    --btn: #7C4DFF;
    --btn-hover: #6B39F0;
    --link: #6B39F0;
    --border: rgba(28, 23, 48, 0.12);
    --border-strong: rgba(28, 23, 48, 0.18);
    --code-bg: rgba(28, 23, 48, 0.06);
  }
}

/* Increase Contrast: the guide's HC values. */
@media (prefers-contrast: more) {
  :root {
    --text: #FFFFFF;
    --text-muted: #C4BED6;
    --accent: #A06BFF;
    --accent-text: #C9B5FF;
    --link: #B8B8FF;
    --btn: #6B39F0;
    --btn-hover: #5A28DC;
    --border: rgba(255, 255, 255, 0.30);
    --border-strong: rgba(255, 255, 255, 0.40);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
  :root {
    --text: #000000;
    --text-muted: #463C5E;
    --accent: #6B39F0;
    --accent-text: #5A28DC;
    --link: #5A28DC;
    --border: rgba(28, 23, 48, 0.40);
    --border-strong: rgba(28, 23, 48, 0.45);
  }
}

/* ---------- 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(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.35em; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

code, kbd, .mono { font-family: var(--font-code); font-size: 0.88em; }
/* Long paths and commands wrap rather than widen a phone's page. */
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-1);
  text-align: center;
  line-height: 1.4;
}

strong { font-weight: 650; }

.muted { color: var(--text-muted); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--btn);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}
.prose { max-width: var(--prose); }

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

.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 30px; height: 30px; display: block; }
.brand span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.035em;
  line-height: 1;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent-text); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-intro { max-width: 640px; margin-bottom: 32px; }
.section-intro p { color: var(--text-muted); font-size: 1.05rem; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 12px;
}

/* ---------- Hero ---------- */

.hero { padding: 72px 0 64px; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-icon { width: 112px; height: 112px; display: block; margin: 0 0 20px -8px; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 9vw, 5.2rem);
  letter-spacing: -0.035em;
  line-height: 0.92;
  margin: 0;
}
.tagline {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  font-size: 1rem;
  margin: 12px 0 24px 4px;
}
.lead {
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 34em;
}
.fine {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 14px 0 0;
}

/* Illustration of the panel at the screen edge */
.edge-illustration {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}
.edge-illustration .screen { fill: var(--surface-2); }
.edge-illustration .menubar { fill: var(--border); }
.edge-illustration .window { fill: var(--surface-1); stroke: var(--border); }
.edge-illustration .panel { fill: var(--surface-1); stroke: var(--border-strong); }
.edge-illustration .line { fill: var(--border-strong); }
.edge-illustration .line-strong { fill: var(--text-muted); }
.edge-illustration .check { fill: none; stroke: var(--accent); stroke-width: 2; }
.edge-illustration .check-done { fill: var(--accent); }
.edge-illustration .tab { fill: var(--code-bg); }
.edge-illustration .tab-active { fill: var(--accent); opacity: 0.22; }
.edge-illustration .keycap { fill: var(--surface-1); stroke: var(--border-strong); }
.edge-illustration .keytext { fill: var(--text); font-family: var(--font-code); font-size: 22px; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
  background: var(--btn);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
}
.button:hover { background: var(--btn-hover); text-decoration: none; }
.button svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.button small { display: block; font-weight: 400; font-size: 0.8rem; opacity: 0.9; }

.button-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.button-secondary:hover { background: var(--code-bg); }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Cards & grids ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); }
.card p + p { margin-top: 0.75em; }

/* Free vs Pro */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.plan { display: flex; flex-direction: column; }
.plan h3 { font-size: 1.45rem; margin-bottom: 4px; }
.plan .price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}
.plan .price span { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; color: var(--text-muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 16px; }
.plan li {
  position: relative;
  padding-left: 1.6em;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.5em;
  width: 0.7em;
  height: 0.38em;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan .note { margin-top: auto; color: var(--text-muted); font-size: 0.92rem; }
.plan-pro { position: relative; overflow: hidden; }
/* The edge-light rule: the only place the gradient appears outside the icon. */
.plan-pro::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--edge);
}

/* Callout with an icon */
.callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.callout img { width: 96px; height: 96px; display: block; }
.callout p { color: var(--text-muted); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Document pages (privacy, support, helper) ---------- */

.page-head { padding: 64px 0 8px; }
.page-head .lead { color: var(--text-muted); }
.page-head-icon { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.page-head-icon img { width: 112px; height: 112px; display: block; flex: none; }
.page-head-icon h1 { margin-bottom: 8px; }
.page-head-icon .lead { margin-bottom: 0; }

.doc { padding: 24px 0 72px; }
.doc h2 {
  font-size: 1.55rem;
  margin-top: 2.2em;
  padding-top: 0.2em;
}
.doc h2:first-child { margin-top: 0.6em; }
.doc h3 { margin-top: 1.8em; }
.doc ol li, .doc ul li { padding-left: 0.2em; }
.doc dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; }
.doc dt { color: var(--text-muted); }
.doc dd { margin: 0; }

.summary {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 8px 0 8px;
}
.summary ul { margin: 0; }

.toc {
  border-left: 2px solid var(--border-strong);
  padding: 4px 0 4px 20px;
  margin: 16px 0 8px;
}
.toc h2 { font-size: 1rem; margin: 0 0 8px; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li + li { margin-top: 0.3em; }

.download-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0 8px;
}
.download-box .fine { margin-top: 12px; }
.checksum {
  margin: 20px 0 0;
}
.checksum dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.checksum dd { margin: 0; }
.hash {
  display: block;
  font-family: var(--font-code);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

pre {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 1em; }

.steps { counter-reset: step; list-style: none; padding: 0; }
/* `.doc .steps` outranks `.doc ol li`, which would take away the badge's room. */
.steps > li,
.doc .steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-top: 18px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

.faq h3 { scroll-margin-top: 16px; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }

/* ---------- 404 ---------- */

.not-found { padding: 96px 0; text-align: center; }
.not-found img { width: 96px; height: 96px; margin: 0 auto 24px; display: block; }
.not-found .button-row { justify-content: center; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 48px; }
  .hero-icon { width: 88px; height: 88px; }
  .page-head { padding-top: 44px; }
  .page-head-icon img { width: 80px; height: 80px; }
  .callout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .callout img { width: 72px; height: 72px; }
  .doc dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc dd { margin-bottom: 10px; }
  .button { width: 100%; justify-content: center; }
  .button-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
