/* =================================================================
   The iceoryx2 Book — theme layer over Furo.
   Palette tokens (--ix-*) and Furo's color-* vars come from conf.py and
   re-theme across light / dark / auto. Keep theme-conditional values in
   those vars, never in [data-theme] selectors — Furo's default is "auto".
   ================================================================= */

/* ---------- fonts: Satoshi (body + headings) · JetBrains Mono (code) ---------- */
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap");

:root,
body {
  --font-stack: "Satoshi", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-stack--monospace: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ix-radius: 16px;
  --ix-radius-sm: 10px;
  --content-padding: 1.5rem;
}

/* =================================================================
   Base + ambient background
   ================================================================= */
html { scroll-behavior: smooth; }
/* Base color goes on <body>, not <html>: Furo defines --ix-* on body and vars
   don't inherit upward, so html would fall through to the OS-tinted canvas
   (breaking light mode on a dark OS). .ix-bg paints just above this. */
body {
  background: var(--ix-bg);
  font-feature-settings: "ss01" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* fixed atmosphere layer injected by atmosphere.js — a single soft glow
   pinned to the top of the viewport, fading out before the reading column */
.ix-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ix-bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}
.ix-bg__glow--1 {
  width: 55vw; height: 40vw; max-width: 680px; max-height: 460px;
  top: -18vw; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, var(--ix-glow-1), transparent 60%);
}

/* let the atmosphere show through the main shell; surfaces below opt back in */
.page, .main, .content, article { background: transparent; }

::selection { background: var(--ix-selection-bg); color: var(--ix-selection-fg); }

/* =================================================================
   Typography
   ================================================================= */
h1, h2, h3, h4, h5, h6,
.sidebar-brand,
.sd-card-title {
  font-family: var(--font-stack);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
  color: var(--ix-text);
}
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-top: 2.6rem; }
h3 { font-size: 1.3rem; margin-top: 1.8rem; }

/* headerlink anchors — quiet until hover */
a.headerlink {
  font-size: 0.7em;
  font-weight: 400;
  color: var(--ix-muted-2);
  opacity: 0;
  padding-left: 0.4em;
  transition: opacity 0.2s, color 0.2s;
  -webkit-text-fill-color: var(--ix-muted-2);
}
h1:hover a.headerlink, h2:hover a.headerlink, h3:hover a.headerlink,
h4:hover a.headerlink, h5:hover a.headerlink, h6:hover a.headerlink { opacity: 1; }
a.headerlink:hover { color: var(--ix-ice); -webkit-text-fill-color: var(--ix-ice); }

/* body links: no permanent underline, ice underline grows on hover */
article a:not(.sd-btn):not(.headerlink):not(.sidebar-brand):not(.ix-btn):not(.ix-colophon__item) {
  text-decoration: none;
  background-image: linear-gradient(var(--ix-ice), var(--ix-ice));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s;
}
article a:not(.sd-btn):not(.headerlink):not(.sidebar-brand):not(.ix-btn):not(.ix-colophon__item):hover {
  color: var(--ix-ice-bright);
  background-size: 100% 1.5px;
}

/* =================================================================
   Homepage hero
   ================================================================= */
/* hero accent span — solid (gradient hook) */
.ix-grad { color: inherit; }
/* reST page title kept for nav/SEO; the hero replaces it visually */
article > section:has(> .ix-hero) > h1:first-child {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.ix-hero {
  position: relative;
  /* sit lower so the hero balances with the sidebar nav; clears the header */
  padding: clamp(5.5rem, 15vh, 11rem) 0 clamp(2.5rem, 6vh, 4.5rem);
  text-align: center;
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.ix-hero__mark {
  color: var(--ix-text);
  margin: 0 auto 1.8rem;
  filter: drop-shadow(0 10px 36px rgba(45, 212, 232, 0.28));
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.ix-hero__mark svg {
  display: block;
  width: clamp(190px, 24vw, 260px);
  height: auto;
  margin: 0 auto;
}
.ix-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-stack--monospace);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ix-ice);
  margin: 0 0 0.9rem;
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) 0.05s both;
}
.ix-hero__eyebrow .ix-hero__word { letter-spacing: 0.18em; }
.ix-hero__eyebrow .ix-hero__two { color: var(--ix-ice-bright); }
.ix-hero__title .ix-hero__two { color: var(--ix-ice); }
.ix-hero__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ix-ice);
  box-shadow: 0 0 10px var(--ix-ice);
}
.ix-hero__title {
  font-family: var(--font-stack);
  font-weight: 700;
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 auto;
  color: var(--ix-text);
  max-width: 22ch;
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) 0.1s both;
}
.ix-hero__lead {
  color: var(--ix-muted);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
  line-height: 1.6;
  max-width: 52ch;
  margin: 1.3rem auto 0;
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) 0.15s both;
}
.ix-hero__code {
  font-family: var(--font-stack--monospace);
  font-size: 0.86em;
  border-radius: 6px;
  border: 1px solid var(--ix-line);
  background: var(--ix-surface-2);
  padding: 0.08em 0.38em;
  color: var(--ix-ice);
}
.ix-hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) 0.2s both;
}
.ix-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-stack);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.78rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  text-decoration: none;
}
.ix-btn svg { transition: transform 0.25s; }
/* pin :visited / :visited:hover so CTAs never show the UA purple */
.ix-btn--primary,
.ix-btn--primary:visited {
  background: linear-gradient(180deg, var(--ix-ice-bright), var(--ix-ice));
  color: #04222a;
  box-shadow: 0 6px 24px -6px rgba(45, 212, 232, 0.55);
}
.ix-btn--primary:hover,
.ix-btn--primary:visited:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px -8px rgba(45, 212, 232, 0.75);
  color: #04222a;
}
.ix-btn--primary:hover svg { transform: translateX(3px); }
.ix-btn--ghost,
.ix-btn--ghost:visited {
  background: var(--ix-surface);
  color: var(--ix-text);
  border-color: var(--ix-line);
  backdrop-filter: blur(6px);
}
.ix-btn--ghost:hover,
.ix-btn--ghost:visited:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 232, 0.5);
  color: var(--ix-text);
}
@keyframes ix-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ix-hero, .ix-hero__mark, .ix-hero__eyebrow, .ix-hero__title,
  .ix-hero__lead, .ix-hero__cta, .ix-colophon { animation: none; }
}

.ix-btn--sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* =================================================================
   Colophon — slim credits bar (maintainer / project affiliation)
   ================================================================= */
.ix-colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.6rem;
  max-width: 760px;
  margin: clamp(1.5rem, 4vh, 3rem) auto 0;
  padding-top: clamp(1.2rem, 3vh, 2rem);
  border-top: 1px solid var(--ix-line);
  animation: ix-rise 0.7s cubic-bezier(.2,.8,.2,1) 0.28s both;
}
/* gap clears the logo's safe zone; hover affordance stays on the label so the
   logo itself is never faded */
.ix-colophon__item {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}
.ix-colophon__label {
  font-family: var(--font-stack--monospace);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ix-muted-2);
  white-space: nowrap;
  /* ice underline grows under the label only, so it never crosses the logo */
  background-image: linear-gradient(var(--ix-ice), var(--ix-ice));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s;
}
.ix-colophon__item:hover .ix-colophon__label {
  color: var(--ix-text);
  background-size: 100% 1.5px;
}
.ix-colophon__logo-img { height: 22px; width: auto; display: block; }
.ix-colophon__logo-img--ef { height: 26px; }
.ix-colophon__sep { width: 1px; align-self: stretch; min-height: 1.4em; background: var(--ix-line); }
@media (max-width: 620px) {
  .ix-colophon__sep { display: none; }
}

/* open-source / license line, kept flush under the copyright with the gap
   falling before the "Made with" credit */
.ix-trademark {
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  color: var(--ix-muted-2);
}

/* =================================================================
   Brand (sidebar header)
   ================================================================= */
.sidebar-brand.ix-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.4rem 0 1.4rem;
  opacity: 1;
}
.ix-brand__mark {
  display: grid;
  place-items: center;
  color: var(--ix-text);
  flex: none;
}
.ix-brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.ix-brand__word {
  font-family: var(--font-stack);
  font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  color: var(--ix-text);
}
.ix-brand__two { color: var(--ix-ice); }
.ix-brand__tag {
  font-family: var(--font-stack--monospace);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ix-muted-2);
  margin-top: 0.25rem;
}
.sidebar-brand.ix-brand:hover .ix-brand__mark { color: var(--ix-ice); }

/* =================================================================
   Sidebars (left navigation + right TOC)
   ================================================================= */
.sidebar-drawer {
  background: var(--ix-drawer-bg);
  border-right: 1px solid var(--ix-line);
  backdrop-filter: blur(8px);
}

.sidebar-search-container { border-bottom: none; }
input.sidebar-search {
  background: var(--ix-surface);
  border: 1px solid var(--ix-line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem 0.55rem 2.4rem;
  font-family: var(--font-stack);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input.sidebar-search:focus {
  outline: none;
  border-color: var(--ix-ice);
  box-shadow: 0 0 0 3px rgba(45, 212, 232, 0.18);
}
.sidebar-search-container::before { opacity: 0.6; }

/* nav links */
.sidebar-tree .caption {
  font-family: var(--font-stack--monospace);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ix-muted-2);
}
.sidebar-tree .reference {
  border-radius: var(--ix-radius-sm);
  transition: color 0.2s, background 0.2s;
}
.sidebar-tree .reference:hover { color: var(--ix-text); }
.sidebar-tree .current-page > .reference {
  font-weight: 600;
  color: var(--ix-ice);
}
/* active page accent bar */
.sidebar-tree .current-page > .reference::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 1.1em;
  border-radius: 2px;
  background: var(--ix-ice);
  box-shadow: 0 0 8px var(--ix-ice);
}
.sidebar-tree .reference { position: relative; }

/* expand/collapse chevrons */
.toctree-checkbox ~ label .icon { color: var(--ix-muted-2); }

/* right-hand "On this page" TOC */
.toc-title {
  font-family: var(--font-stack--monospace);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ix-muted-2);
}
.toc-tree li.scroll-current > .reference {
  color: var(--ix-ice);
  font-weight: 600;
}
.toc-tree { border-left: 1px solid var(--ix-line); }

/* =================================================================
   Theme toggle / mobile header
   ================================================================= */
.theme-toggle { color: var(--ix-muted); transition: color 0.2s; }
.theme-toggle:hover { color: var(--ix-ice); }
/* kill transitions for the instant the theme flips (no sidebar color flicker) */
html.ix-theme-switching,
html.ix-theme-switching *,
html.ix-theme-switching *::before,
html.ix-theme-switching *::after { transition: none !important; }
/* keep the toggle clickable above the hero, whose full-width block would
   otherwise overlap this top-right control and swallow the clicks */
.content-icon-container { position: relative; z-index: 5; }
.mobile-header {
  background: var(--ix-header-bg);
  border-bottom: 1px solid var(--ix-line);
  backdrop-filter: blur(14px) saturate(140%);
}

/* =================================================================
   Code blocks
   ================================================================= */
.highlight {
  border-radius: var(--ix-radius-sm);
  border: 1px solid var(--ix-line);
  box-shadow: var(--ix-shadow);
  /* cool, theme-matched surface — Furo's neutral grey reads warm/beige next
     to the cool page background. !important beats Furo's Pygments rules. */
  background: var(--ix-code-bg) !important;
}
/* emphasized lines (:emphasize-lines:) — cool tint instead of Furo's cream */
.highlight .hll { background-color: var(--ix-code-hl) !important; }
.highlight pre {
  font-family: var(--font-stack--monospace);
  font-size: 0.86rem;
  line-height: 1.7;
  padding: 1.1rem 1.25rem;
  /* keep code literal: render "!=", "->", "==" as typed, not as ligatures */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
/* inline code */
code.literal, .rst-content code:not(.xref) {
  font-family: var(--font-stack--monospace);
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  font-size: 0.86em;
  border-radius: 6px;
  border: 1px solid var(--ix-line);
  background: var(--ix-surface-2);
  padding: 0.12em 0.4em;
}
/* copy button */
.highlight button.copybtn { border-radius: 7px; }

/* heading anchor — a sleek link icon (replaces the default "#") */
a.headerlink {
  font-size: 0;                 /* hide the "#" glyph; the icon is drawn via ::after */
  margin-left: 0.45rem;
  vertical-align: middle;
  line-height: 0;
  text-decoration: none;
}
a.headerlink::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  background-color: var(--ix-ice);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.25'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.25'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --- brand syntax palette ----------------------------------------------
   Replaces Furo's Pygments token colors (which lean orange/amber) with the
   iceoryx palette. Uses --ix-* vars so one rule set themes light + dark;
   !important is needed to beat Furo's per-theme `body[data-theme]` rules. */
.highlight .c, .highlight .ch, .highlight .cm, .highlight .c1, .highlight .cs,
.highlight .cp, .highlight .cpf { color: var(--ix-muted-2) !important; font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp,
.highlight .kr, .highlight .ow, .highlight .nt { color: var(--ix-blue) !important; }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .nb, .highlight .bp,
.highlight .no, .highlight .ne { color: var(--ix-ice) !important; }
.highlight .nf, .highlight .fm, .highlight .nd { color: var(--ix-ice-bright) !important; }
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl,
.highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si,
.highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: var(--ix-mint) !important; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi,
.highlight .mo, .highlight .il, .highlight .l, .highlight .ld { color: var(--ix-blue) !important; }
.highlight .o, .highlight .p, .highlight .na, .highlight .nv, .highlight .vc,
.highlight .vg, .highlight .vi, .highlight .nl, .highlight .py,
.highlight .w { color: var(--color-code-foreground) !important; }
.highlight .gp { color: var(--ix-muted-2) !important; }   /* shell prompt */
.highlight .err { color: #ff6b6b !important; background: none !important; }

/* =================================================================
   Admonitions
   ================================================================= */
/* Flat left-accent callouts; --ix-callout drives border, icon and title.
   !important is required: Furo's per-type rules (.admonition.important >
   .admonition-title) outweigh these, so without it only typeless admonitions
   restyle while typed ones keep Furo's filled bar. */
.admonition, div.admonition {
  --ix-callout: var(--ix-ice);
  --ix-callout-bg: rgba(45, 212, 232, 0.06);
  border: 1px solid var(--ix-line) !important;
  border-left: 3px solid var(--ix-callout) !important;
  border-radius: 8px;
  background: var(--ix-callout-bg) !important;
  box-shadow: none;
  overflow: hidden;
}
.admonition > .admonition-title {
  background: transparent !important;
  font-family: var(--font-stack);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ix-callout) !important;
}
/* Furo renders the icon as a masked ::before — color it with the accent */
.admonition > .admonition-title::before { background-color: var(--ix-callout) !important; }

.admonition.note, .admonition.seealso {
  --ix-callout: var(--ix-ice); --ix-callout-bg: rgba(45, 212, 232, 0.06);
}
.admonition.important, .admonition.attention {
  --ix-callout: var(--ix-blue); --ix-callout-bg: rgba(91, 141, 239, 0.06);
}
.admonition.tip, .admonition.hint {
  --ix-callout: var(--ix-mint); --ix-callout-bg: rgba(111, 240, 199, 0.06);
}
.admonition.warning, .admonition.caution {
  --ix-callout: #e0a13a; --ix-callout-bg: rgba(224, 161, 58, 0.07);
}
.admonition.danger, .admonition.error {
  --ix-callout: #ff6b6b; --ix-callout-bg: rgba(255, 107, 107, 0.07);
}

/* =================================================================
   sphinx-design — cards
   ================================================================= */
/* breathing room between a preceding heading and a card grid */
.sd-container-fluid { margin-top: 1.75rem; }
.sd-card {
  border-radius: var(--ix-radius) !important;
  border: 1px solid var(--ix-line) !important;
  background: var(--ix-card-bg) !important;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), border-color 0.3s, box-shadow 0.3s;
}
.sd-card::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(80% 60% at 50% 0%, rgba(45, 212, 232, 0.12), transparent 70%);
  pointer-events: none;
}
.sd-card:hover {
  transform: translateY(-5px);
  border-color: var(--ix-card-hover-border) !important;
  box-shadow: var(--ix-card-shadow);
}
.sd-card:hover::after { opacity: 1; }
.sd-card .sd-card-title { font-size: 1.18rem; }
/* cards that are whole links */
.sd-card a.sd-stretched-link, .sd-card .sd-card-title { color: var(--ix-text); }
.sd-card:hover .sd-card-title { color: var(--ix-ice); }
/* octicons inside cards / content */
.sd-octicon { color: var(--ix-ice); vertical-align: -0.12em; }
/* GitHub mark in the brand's monochrome tone (black on light, white on dark) */
.sd-octicon-mark-github { color: var(--ix-text); }

.muted-card { opacity: 0.55; }

/* =================================================================
   sphinx-design — tabs (tab-set / tab-set-code)
   ================================================================= */
.sd-tab-set { border-radius: var(--ix-radius); }
.sd-tab-set > label {
  font-family: var(--font-stack--monospace);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ix-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.sd-tab-set > label:hover { color: var(--ix-text); }
.sd-tab-set > input:checked + label {
  color: var(--ix-ice);
  border-bottom-color: var(--ix-ice);
}
/* tab panel: square top (meets the active tab label), rounded bottom */
.sd-tab-content {
  border: 1px solid var(--ix-line);
  border-top: none;
  border-radius: 0 0 var(--ix-radius-sm) var(--ix-radius-sm);
  background: transparent;
  padding: 1rem;
}
/* code blocks inside prose tabs: a clean inner surface, no heavy shadow */
.sd-tab-content .highlight {
  border: 1px solid var(--ix-line);
  border-radius: 8px;
  box-shadow: none;
}
/* code-only tabs: code fills the panel flush (block is wrapped in
   div.highlight-<lang>). Drop the padding rather than use negative margins —
   sphinx-design forces first/last-child margins to 0 !important, leaving a gap. */
.sd-tab-content:has(> [class*="highlight-"]:only-child) { padding: 0; }
.sd-tab-content > [class*="highlight-"]:only-child > .highlight {
  border: none;
  border-radius: 0 0 var(--ix-radius-sm) var(--ix-radius-sm);
}

/* =================================================================
   sphinx-design — buttons (pill style, like the site CTAs)
   ================================================================= */
.sd-btn {
  border-radius: 999px !important;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.sd-btn-primary, .sd-btn-outline-primary {
  background: linear-gradient(180deg, var(--ix-ice-bright), var(--ix-ice)) !important;
  border-color: transparent !important;
  color: #04222a !important;
  box-shadow: 0 6px 24px -6px rgba(45, 212, 232, 0.5);
}
.sd-btn-primary:hover, .sd-btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px -8px rgba(45, 212, 232, 0.7);
}

/* =================================================================
   Figures & images
   ================================================================= */
figure img, .figure img, img.align-center {
  border-radius: var(--ix-radius-sm);
}
figcaption, .caption-text {
  color: var(--ix-muted);
  font-size: 0.9rem;
}
/* SVG diagrams get a soft panel in dark mode for legibility (vars collapse to
   none in light); logos are excluded so they don't sit on a white box */
.content img[src$=".svg"]:not(.ix-colophon__logo-img) {
  background: var(--ix-svg-panel);
  border-radius: var(--ix-radius-sm);
  padding: var(--ix-svg-pad);
}

/* mermaid diagrams */
.mermaid { display: flex; justify-content: center; }

/* inline themed diagrams (SVG reads --ix-* vars, so it themes with the page) */
.ix-diagram { margin: 1.8rem auto; max-width: 640px; text-align: center; }
.ix-diagram__scroll { width: 100%; }
.ix-diagram svg { width: 100%; height: auto; display: block; }
.ix-diagram figcaption { margin-top: 0.85rem; color: var(--ix-muted); font-size: 0.9rem; }
/* wide, dense layered diagram — allow it to use the full content width */
#fig-grand-vision { max-width: 100%; }

/* Dense diagrams: on narrow screens hold a minimum width and scroll
   horizontally rather than shrinking text to an unreadable size. */
@media (max-width: 720px) {
  #fig-grand-vision .ix-diagram__scroll,
  #fig-execution-control-with-waitset .ix-diagram__scroll,
  #fig-gateways-and-tunnels .ix-diagram__scroll,
  #fig-wiring-a-robot-brain-request-response-sequence .ix-diagram__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #fig-grand-vision svg,
  #fig-execution-control-with-waitset svg { min-width: 680px; }
  #fig-gateways-and-tunnels svg,
  #fig-wiring-a-robot-brain-request-response-sequence svg { min-width: 560px; }
}

/* =================================================================
   Tables
   ================================================================= */
table.docutils {
  border-radius: var(--ix-radius-sm);
  overflow: hidden;
  border: 1px solid var(--ix-line);
  border-collapse: separate;
  border-spacing: 0;
}
table.docutils thead th {
  background: var(--ix-surface-2);
  font-family: var(--font-stack--monospace);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ix-muted);
  border-bottom: 1px solid var(--ix-line);
}
table.docutils td, table.docutils th { border-color: var(--ix-line); }

/* =================================================================
   Misc polish
   ================================================================= */
.bg-grid, .related-pages a { transition: color 0.2s; }
/* prev / next footer nav */
.prev-next-area a.left-next:hover,
.prev-next-area a.right-next:hover { border-color: rgba(45, 212, 232, 0.4); }
.prev-next-area .page-info .title { color: var(--ix-text); }

/* blockquotes */
blockquote {
  border-left: 3px solid var(--ix-ice);
  background: var(--ix-surface);
  border-radius: 0 var(--ix-radius-sm) var(--ix-radius-sm) 0;
  padding: 0.6rem 1.1rem;
}

/* focus ring */
:focus-visible { outline: 2px solid var(--ix-ice); outline-offset: 3px; border-radius: 4px; }

/* =================================================================
   Reduced motion
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sd-card, .sd-btn { transition: none; }
}

/* =================================================================
   Print — force a light, ink-friendly layout and drop chrome/effects.
   The diagrams read the --ix-* vars, so overriding them to the light
   palette makes the inline SVGs print light as well.
   ================================================================= */
@media print {
  body {
    /* brand tokens → paper */
    --ix-bg: #ffffff !important;
    --ix-bg-2: #eef3f9 !important;
    --ix-surface: #ffffff !important;
    --ix-surface-2: #f2f6fb !important;
    --ix-line: rgba(15, 55, 90, 0.22) !important;
    --ix-ice: #0a7385 !important;
    --ix-blue: #2f59bf !important;
    --ix-mint: #0b8a66 !important;
    --ix-text: #0c1825 !important;
    --ix-muted: #33485a !important;
    --ix-muted-2: #56697b !important;
    --ix-code-bg: #f1f5f9 !important;
    /* Furo mappings */
    --color-background-primary: #ffffff !important;
    --color-background-secondary: #ffffff !important;
    --color-foreground-primary: #0c1825 !important;
    --color-foreground-secondary: #33485a !important;
    --color-code-background: #f1f5f9 !important;
    --color-code-foreground: #1f3346 !important;
    background: #ffffff !important;
    color: #0c1825 !important;
  }

  /* drop interactive chrome / effects */
  .sidebar-drawer,
  .toc-drawer,
  .mobile-header,
  .content-icon-container,
  .back-to-top,
  .related-pages,
  .ix-bg,
  .copybtn,
  .version-picker,
  a.headerlink { display: none !important; }

  /* content fills the page */
  .page, .main { display: block !important; }
  .content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* flat surfaces on paper */
  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }

  /* keep intended backgrounds/borders (else they'd drop to white) */
  .ix-diagram, .ix-diagram svg,
  .highlight, .admonition, .sd-card {
    -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
  }

  /* avoid awkward page breaks */
  figure, pre, table, .admonition, .sd-card, .ix-diagram { break-inside: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }

  /* no entrance animations on paper */
  * { animation: none !important; }
}
