/* Camoufox theme: flat Material on OLED black.
   Tokens, type, and the components that both the docs and the marketing pages draw.
   The rules of the system: one black ground, tonal surfaces instead of shadows, every corner
   rounded, and all spacing taken from the 4px scale below. */

/* Google Sans Flex and Google Sans Code (SIL OFL), self-hosted from /static/fonts, latin and
   latin-ext only since the docs are English. They used to come from fonts.googleapis.com, whose
   stylesheet blocked the first paint on two third-party connections; now the two latin files are
   preloaded by each page head and arrive with the page. Taken from the css2 URL for
   Google+Sans+Flex:wght,ROND@400..700,0..100 and Google+Sans+Code:wght@400..600. */
@font-face {
  font-family: 'Google Sans Code';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/static/fonts/google-sans-code-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Google Sans Code';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/static/fonts/google-sans-code-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/google-sans-flex-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/google-sans-flex-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --bg: #000;
  --surface-1: #0b0b0c;
  --surface-2: #131314;
  --surface-3: #1c1c1e;
  --surface-4: #26262a;
  --outline: #222225;
  --outline-strong: #35353a;

  --text: #ececee;
  --text-dim: #a3a3aa;
  --text-faint: #7c7c85;

  --accent: #ef7a5d;                 /* the fox's orange, static/camoufox-mark.svg */
  --accent-hover: #f59378;
  --accent-container: #26130e;
  --on-accent-container: #ffc9bb;
  --on-accent: #1b0a05;
  --pro: #72e9d7;                    /* Pro */
  --wolf: #8c9beb;                   /* Camouwolf, static/camouwolf-mark.svg */

  --info: #8ab4f8;
  --success: #81c995;
  --warning: #fdd663;
  --danger: #f28b82;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Google Sans Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 64px;

  /* Retype's variable names, still used by the sponsor blocks in _includes/head.html. */
  --base-bg: var(--bg);
  --border-color: var(--outline);
  --body-text: var(--text-dim);
  --heading-text: var(--text);
  --callout-base-bg: var(--surface-1);
  --callout-primary: var(--accent);
  --callout-danger: var(--danger);
  --cfx-accent: var(--accent);
  --cfx-accent-hover: var(--accent-hover);
}

/* Everything under .pro runs on the Pro accent. (.dusk is the pricing page's name for the same.) */
.pro, .dusk {
  --accent: var(--pro);
  --accent-hover: #9af1e3;
  --accent-container: #0a231f;
  --on-accent-container: #b9f5ec;
  --on-accent: #03201b;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-5));
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--surface-4) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-variation-settings: "ROND" 100;   /* the rounded cut of the face, for headings only */
  text-wrap: balance;
}
p, ul, ol, dl, dd, figure, pre, blockquote { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img, video, svg { max-width: 100%; }
.octicon { flex: none; fill: currentColor; vertical-align: text-bottom; }

::selection { background: var(--accent); color: var(--on-accent); }

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

code, kbd, pre, samp { font-family: var(--mono); }
:not(pre) > code {
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}
kbd {
  padding: 2px 7px;
  border: 1px solid var(--outline-strong);
  border-radius: var(--r-xs);
  color: var(--text-dim);
  font-size: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus { transform: none; color: var(--on-accent); }

/* ── Brand and buttons ─────────────────────────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  font-variation-settings: "ROND" 100;
}
.brand:hover { color: var(--text); }
.brand img { width: auto; height: 28px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text);
  font: 500 0.9375rem/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-4); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { border-color: var(--outline-strong); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { height: 48px; padding: 0 28px; font-size: 1rem; }
.btn:focus-visible { border-radius: var(--r-full); }

/* Small screens: the button that opens the site's links, in the site header and the docs top bar. */
.menu-btn {
  display: none;
  height: 36px;
  padding: 0 var(--s-4);
  border: 1px solid var(--outline-strong);
  border-radius: var(--r-full);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
@media (max-width: 900px) { .menu-btn { display: block; } }

.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 var(--s-3);
  border-radius: var(--r-full);
  background: var(--accent-container);
  color: var(--on-accent-container);
  font-size: 0.8125rem;
  font-weight: 500;
}
.chip:hover { color: var(--on-accent-container); }

/* [!badge …]: which browser a line is about, tinted with that browser's colour. */
.badge {
  --tint: var(--text-dim);
  display: inline-block;
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--tint) 14%, transparent);
  color: var(--tint);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 0.1em;
}
.badge-camoufox-only { --tint: var(--accent); }
.badge-camouwolf-only { --tint: var(--wolf); }
.badge-warning { --tint: var(--warning); }
.badge-danger { --tint: var(--danger); }
.badge-success { --tint: var(--success); }
.badge-info { --tint: var(--info); }

/* ── Code ──────────────────────────────────────────────────────────────────────────────────── */

.code {
  position: relative;
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.code pre {
  padding: var(--s-4) 20px;
  overflow-x: auto;
  border-radius: inherit;
  font-size: 0.875rem;
  line-height: 1.7;
  tab-size: 4;
}
.code code { display: inline-block; min-width: 100%; font: inherit; }
.code-title {
  padding: 10px 20px;
  border-bottom: 1px solid var(--outline);
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.copy {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}
.code:hover .copy, .copy:focus-visible, .copy.done { opacity: 1; }
.copy:hover { background: var(--surface-4); color: var(--text); }
.copy .octicon-check, .copy.done .octicon-copy { display: none; }
.copy.done .octicon-check { display: block; color: var(--success); }
@media (hover: none) { .copy { opacity: 1; } }

.numbered pre { padding-inline: 0; counter-reset: line; }
.numbered .line { display: block; padding-right: 20px; }
.numbered .line::before {
  content: counter(line);
  counter-increment: line;
  display: inline-block;
  width: 48px;
  padding-right: var(--s-4);
  color: var(--text-faint);
  text-align: right;
  user-select: none;
}
.line.hot { background: var(--accent-container); }
.line.hot::before { color: var(--on-accent-container); }

.hljs-comment, .hljs-quote { color: var(--text-faint); }
.hljs-keyword, .hljs-literal, .hljs-selector-tag { color: #ff9e85; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #81c995; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #fdd663; }
.hljs-title, .hljs-section { color: #8ab4f8; }
.hljs-built_in, .hljs-type { color: #c58af9; }
.hljs-meta, .hljs-deletion { color: #f28b82; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }

/* ── Tabs ──────────────────────────────────────────────────────────────────────────────────── */

.tabs {
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
}
.tab-bar {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-2);
  overflow-x: auto;
  border-bottom: 1px solid var(--outline);
  scrollbar-width: none;
}
.tab-bar button {
  flex: none;
  height: 36px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-dim);
  font: 500 0.9375rem/1 var(--font);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.tab-bar button:hover { background: var(--surface-2); color: var(--text); }
.tab-bar button[aria-selected="true"] { background: var(--accent-container); color: var(--on-accent-container); }
.tab-bar button:focus-visible { border-radius: var(--r-full); outline-offset: -2px; }
.tab-panel { padding: 20px; }
.tab-panel:has(> .code:only-child) { padding: 0; }
.tab-panel > .code:only-child {
  border: 0;
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
  background: transparent;
}
