:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --panel: #ffffff;
  --panel-soft: #f2f5f7;
  --ink: #202124;
  --muted: #62666d;
  --line: #dfe3e8;
  --accent: #1473e6;
  --accent-strong: #0b5fc4;
  --cloud: #1677ff;
  --local: #20814f;
  --warn: #9a5b00;
  --code: #eef2f5;
  --shadow: 0 18px 50px rgba(20, 32, 46, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171b;
  --panel: #202329;
  --panel-soft: #262b33;
  --ink: #f2f4f7;
  --muted: #aab0bb;
  --line: #383f4a;
  --accent: #5aa2ff;
  --accent-strong: #8fc1ff;
  --cloud: #5aa2ff;
  --local: #56c18b;
  --warn: #f2b057;
  --code: #111318;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #15171b;
    --panel: #202329;
    --panel-soft: #262b33;
    --ink: #f2f4f7;
    --muted: #aab0bb;
    --line: #383f4a;
    --accent: #5aa2ff;
    --accent-strong: #8fc1ff;
    --cloud: #5aa2ff;
    --local: #56c18b;
    --warn: #f2b057;
    --code: #111318;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

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

a:hover {
  text-decoration: underline;
}

.docs-nav a:focus-visible,
.card-link:focus-visible,
.button-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.docs-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.docs-shell.narrow {
  width: min(880px, calc(100% - 40px));
}

.docs-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.docs-brand {
  font-weight: 700;
  color: var(--ink);
  margin-right: auto;
  flex-shrink: 0;
}

.docs-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.95rem;
}

.docs-nav-links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

.docs-nav-toggle {
  display: none;
}

.docs-nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.docs-nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.docs-nav-burger span::before,
.docs-nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.15s ease;
}

.docs-nav-burger span::before {
  top: -6px;
}

.docs-nav-burger span::after {
  top: 6px;
}

.docs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.docs-theme-toggle:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

.docs-theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.docs-theme-toggle .theme-glyph {
  display: none;
}

:root[data-theme-pref="auto"] .docs-theme-toggle .theme-glyph-auto,
:root:not([data-theme-pref]) .docs-theme-toggle .theme-glyph-auto,
:root[data-theme-pref="light"] .docs-theme-toggle .theme-glyph-light,
:root[data-theme-pref="dark"] .docs-theme-toggle .theme-glyph-dark {
  display: inline;
}

.tool-switcher {
  display: flex;
  width: fit-content;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: var(--panel);
  gap: 2px;
  margin: 12px 0 20px;
}

.tool-switcher button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tool-switcher button:hover {
  color: var(--ink);
}

.tool-switcher button[aria-pressed="true"] {
  background: var(--accent);
  color: white;
}

.tool-switcher button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[data-tool-section] {
  display: none;
}

:root[data-tool="claude-code"] [data-tool-section="claude-code"],
:root:not([data-tool]) [data-tool-section="claude-code"],
:root[data-tool="codex"] [data-tool-section="codex"] {
  display: block;
}

[data-channel-section] {
  display: none;
}

:root[data-channel="dmg"] [data-channel-section="dmg"],
:root:not([data-channel]) [data-channel-section="dmg"],
:root[data-channel="appstore"] [data-channel-section="appstore"],
:root[data-channel="linux"] [data-channel-section="linux"] {
  display: block;
}

@media (max-width: 760px) {
  .docs-nav-burger {
    display: inline-flex;
  }

  .docs-nav-links {
    display: none;
    order: 100;
    flex-basis: 100%;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .docs-nav-links a {
    padding: 10px 4px;
    border-radius: 6px;
  }

  .docs-nav-toggle:checked ~ .docs-nav-links {
    display: flex;
  }

  .docs-nav-toggle:checked ~ .docs-nav-burger span {
    background: transparent;
  }

  .docs-nav-toggle:checked ~ .docs-nav-burger span::before {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .docs-nav-toggle:checked ~ .docs-nav-burger span::after {
    transform: rotate(-45deg) translate(4px, -4px);
  }
}

.breadcrumb {
  margin: 30px 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero {
  padding: 48px 0 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: center;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.16;
}

h1 {
  max-width: 780px;
  margin: 8px 0 16px;
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  letter-spacing: 0;
}

/* Marketing-scale hero only on the docs index. Inner pages stay at
   docs-scale h1 (above). */
.hero-home h1 {
  font-size: clamp(2.35rem, 5vw, 4.4rem);
}

/* "Back to the Future" hero text: vertical gradient echoing the film logo
   (deep red top, orange-yellow bottom) with a subtle silver edge. Letters
   are not distorted; only color and a faint stroke change. */
.dl-trigger {
  background: linear-gradient(
    180deg,
    #a8221c 0%,
    #e7401f 28%,
    #f58a1f 52%,
    #fbb31f 74%,
    #ffe14a 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 0.5px rgba(120, 120, 130, 0.45);
  text-decoration: underline dotted rgba(229, 64, 31, 0.6);
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
  font-weight: 800;
}
[data-theme="dark"] .dl-trigger {
  -webkit-text-stroke: 0.5px rgba(220, 220, 230, 0.35);
  text-decoration-color: rgba(251, 179, 31, 0.6);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* Baseline tile treatment: a soft blue wash on every card-link so the
   tile grid reads less like flat grey panels. */
.card-link {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.20);
}
[data-theme="dark"] .card-link {
  background: rgba(96, 165, 250, 0.06);
  border-color: rgba(96, 165, 250, 0.22);
}

h2 {
  margin: 28px 0 14px;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

p {
  margin: 0 0 14px;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.14rem;
}

.section {
  padding: 12px 0 30px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.callout,
.visual-card,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card p,
.callout p,
.visual-card p {
  color: var(--muted);
}

.card-link {
  display: block;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  /* Selecting text inside a card should not start a native link drag that
     "grabs" the whole card. Disable link dragging, keep text selectable. */
  -webkit-user-drag: none;
  user-select: text;
}

.card-link h3 {
  color: var(--accent);
}

.card-link h3::after {
  content: " \203A";
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.15s ease;
}

.card-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 22px 56px rgba(20, 32, 46, 0.12);
}

.card-link:hover h3::after {
  transform: translateX(3px);
}

.card-link:active {
  transform: translateY(1px);
}

@media (prefers-color-scheme: dark) {
  .card-link:hover {
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
  }
}

.card.compact {
  box-shadow: none;
}

.card.compact p:last-child,
.notice p:last-child,
.step p:last-child {
  margin-bottom: 0;
}

.docs-main {
  padding-bottom: 10px;
}

.docs-main > p,
.docs-main > ul,
.docs-main > ol {
  max-width: 780px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.cta-or {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.button-link.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.button-link:hover {
  text-decoration: none;
  background: var(--accent-strong);
}

.button-link.secondary:hover {
  background: var(--panel-soft);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.top-space {
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 0.84rem;
  background: var(--panel-soft);
}

.steps {
  display: grid;
  gap: 12px;
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  padding: 16px 16px 16px 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 16px;
  left: 16px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
}

.flow {
  display: grid;
  gap: 10px;
}

.flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
}

.node {
  display: grid;
  align-content: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.node strong {
  display: block;
}

.node span {
  color: var(--muted);
  font-size: 0.92rem;
}

.arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.check-list,
.plain-list {
  padding-left: 1.15rem;
  margin: 10px 0 0;
}

.check-list li,
.plain-list li {
  margin: 7px 0;
}

.code-block {
  overflow-x: auto;
  margin: 12px 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--code);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.9rem;
}

.code-block code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
}

code,
kbd {
  border-radius: 5px;
  padding: 0.12em 0.34em;
  background: var(--code);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.9em;
}

.table-wrap {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status-good {
  color: var(--local);
  font-weight: 700;
}

.status-attention {
  color: var(--warn);
  font-weight: 700;
}

.notice {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-soft));
  padding: 14px 16px 14px 46px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.notice::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 15px;
  width: 18px;
  height: 18px;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notice.warning {
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel-soft));
}

.notice.warning::before {
  background-color: var(--warn);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

/* Inside the split-note grid, the inline labels carry meaning and the grid gap
   handles spacing, so no icon or extra padding there. */
.split-note .notice {
  margin-bottom: 0;
  padding-left: 16px;
}
.split-note .notice::before {
  content: none;
}

.last-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 28px;
}

.mini-map {
  display: grid;
  gap: 10px;
}

.map-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}

.map-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 800;
}

.split-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* "What moves" statements: lighter than callout boxes. A leading icon carries
   the meaning (check = syncs up, monitor = stays on this Mac); no box chrome. */
.sync-points {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
}
.sync-point {
  position: relative;
  margin: 0;
  padding-left: 30px;
  line-height: 1.6;
}
.sync-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 19px;
  height: 19px;
}
.sync-point-yes::before {
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sync-point-no::before {
  background-color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E") center / contain no-repeat;
}

footer {
  margin-top: 56px;
  padding: 24px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

footer a {
  margin-right: 14px;
}

/* Structured docs footer: grouped link columns + a brand/legal bar. */
footer.docs-footer {
  padding: 40px 0 48px;
}
.docs-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
  margin-bottom: 28px;
}
.docs-footer-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.docs-footer-col h4 {
  margin: 0 0 3px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.docs-footer-col a {
  margin: 0;
  color: var(--muted);
  text-decoration: none;
}
.docs-footer-col a:hover {
  color: var(--accent);
}
.docs-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.docs-footer-brand {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.docs-footer-brand:hover {
  color: var(--accent);
}
@media (max-width: 640px) {
  .docs-footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  .docs-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .grid,
  .grid.two,
  .flow-row,
  .split-note {
    grid-template-columns: 1fr;
  }

  .arrow {
    transform: rotate(90deg);
  }

  h1 {
    font-size: 2.45rem;
  }
}

@media (max-width: 560px) {
  .docs-shell {
    width: min(100% - 28px, 1120px);
  }

  .docs-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}
