/* Samaya's light and dark palettes, from apps/native/src/theme.rs. */
@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url(/fonts/FiraSans-Regular.woff2) format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url(/fonts/FiraSans-Medium.woff2) format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url(/fonts/FiraSans-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Fira Mono"; font-weight: 400; font-display: swap; src: url(/fonts/FiraMono-Regular.woff2) format("woff2"); }

:root {
  --bg: #ffffff;
  --panel: #f6f6f7;
  --weak: #e8e8ea;
  --hover: #f1f1f2;
  --text: #0b0b0c;
  --muted: #5c5d61;
  --accent: #5865f2;
  --link: #4b57e0;
  --warn: #b5790f;
  --warn-text: #8a5900;
  --radius: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1f22;
    --panel: #2b2d31;
    --weak: #3f4145;
    --hover: #35373c;
    --text: #f2f3f5;
    --muted: #a3a5a9;
    --warn: #d9a03a;
    --warn-text: #d9a03a;
    --link: #929bff;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); scroll-padding-top: 72px; }
body {
  margin: 0;
  font: 16px/1.6 "Fira Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
pre code { font: inherit; }
code, pre { font: 0.9em/1.55 "Fira Mono", ui-monospace, monospace; }
:not(pre) > code { background: var(--hover); padding: 0.1em 0.35em; border-radius: 4px; }
pre {
  background: var(--panel);
  border: 1px solid var(--weak);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
}
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--weak);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
}
.bar nav { display: flex; align-items: center; gap: 22px; }
.bar nav a:not(.button) { color: var(--muted); }
.bar nav a:not(.button):hover { color: var(--text); text-decoration: none; }
.bar nav a[aria-current] { color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand picture { display: flex; }
.brand img { width: 28px; height: 28px; border-radius: var(--radius); }
.prebeta {
  background: color-mix(in srgb, var(--warn) 12%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--bg));
  padding: 8px 24px;
  text-align: center;
  font-size: 14px;
}
.prebeta b, .tag { color: var(--warn-text); }
.tag:hover { text-decoration: none; background: color-mix(in srgb, var(--warn) 10%, transparent); }
.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 3px 12px;
  border: 1px solid var(--warn);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
footer.bar { color: var(--muted); font-size: 14px; border-top: 1px solid var(--weak); max-width: none; padding: 24px max(24px, calc(50% - 536px)); }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.large { padding: 11px 24px; font-size: 17px; }
.button.quiet { background: var(--hover); color: var(--text); border: 1px solid var(--weak); }

/* Home */
.home { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.home h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.015em; margin: 6px 0 14px; }
.home section p { color: var(--muted); font-size: 17px; }
.eyebrow { color: var(--link); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hero { text-align: center; padding: 72px 0 32px; }
.hero h1 { font-size: clamp(36px, 5.6vw, 60px); max-width: 14em; margin: 0 auto 18px; letter-spacing: -0.025em; }
.hero p { font-size: 19px; max-width: 34em; margin: 0 auto 30px; }
.hero small { display: block; color: var(--muted); margin-top: 16px; font-size: 14px; }
.actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Radio-driven segmented switches: the theme showcase and the install tabs. */
.showcase > input, .install > input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  display: flex;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 3px;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--weak);
  border-radius: 999px;
}
.switch label { padding: 5px 16px; border-radius: 999px; color: var(--muted); font-size: 14px; cursor: pointer; }
.switch label:hover { color: var(--text); }
#t-light:checked ~ .switch [for=t-light], #t-dark:checked ~ .switch [for=t-dark], #t-black:checked ~ .switch [for=t-black],
#os-linux:checked ~ .switch [for=os-linux], #os-windows:checked ~ .switch [for=os-windows] { background: var(--accent); color: #fff; }
.showcase > input:focus-visible ~ .switch, .install > input:focus-visible ~ .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.frame { position: relative; aspect-ratio: 1440 / 860; }
.hint { display: none; margin-top: 4px; color: var(--muted); font-size: 13px; text-align: center; }
.frame img, .feature img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--weak);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 10px 28px -14px rgb(0 0 0 / 0.2);
}
.frame img { box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 14px 36px -16px rgb(0 0 0 / 0.28); }
.frame img { position: absolute; inset: 0; visibility: hidden; }
#t-light:checked ~ .frame-scroll .s-light, #t-dark:checked ~ .frame-scroll .s-dark, #t-black:checked ~ .frame-scroll .s-black { visibility: visible; }

.feature, .org {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px;
  align-items: center;
  padding: 112px 0 0;
}
.feature.wide { grid-template-columns: minmax(0, 1fr); gap: 32px; }
.feature.wide > div { max-width: 40em; }
.feature.wide img { max-width: 852px; margin-inline: auto; }
.feature picture { display: block; background: var(--panel); border: 1px solid var(--weak); border-radius: 14px; padding: clamp(16px, 3vw, 32px); }
.feature.flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.feature.flip > div { order: 2; }
.feature img.narrow { max-width: 380px; margin-inline: auto; }
.feature picture:has(> img.narrow) { width: 100%; max-width: 460px; justify-self: end; }
.feature.flip picture:has(> img.narrow) { justify-self: start; }
.feature:has(img.narrow), .feature.flip:has(img.narrow) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.org pre { margin: 0; padding: 20px 22px; font-size: 15px; }
.org .k { color: var(--link); font-weight: 600; }
.org .p { color: #d4536d; }
.org .m, .org .d { color: var(--muted); }

.integrations { text-align: center; padding: 112px 0 0; }
.integrations ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0; margin: 24px 0; list-style: none; }
.integrations a {
  display: flex;
  color: var(--text);
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--weak);
  border-radius: 999px;
  font-weight: 500;
}
.integrations a:hover { border-color: var(--accent); text-decoration: none; }
.integrations i { width: 20px; height: 20px; background: currentColor; mask: var(--m) center / contain no-repeat; }
.integrations p { max-width: 36em; margin: 0 auto; }

.install { text-align: center; padding: 88px 0 88px; }
.install .panes { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 920px; margin: 0 auto; }
.install .pane { grid-area: 1 / 1; visibility: hidden; }
#os-linux:checked ~ .panes .os-linux, #os-windows:checked ~ .panes .os-windows { visibility: visible; }
.install pre { font-size: 14px; text-align: left; }
.copy { z-index: 1; }
.cmd { position: relative; margin: 1em 0; background: var(--panel); border: 1px solid var(--weak); border-radius: var(--radius); }
.cmd pre { margin: 0 70px 0 0; border: 0; background: none; white-space: pre; overflow-x: auto; }
.cmd pre.overflow-right { mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  font: 500 13px "Fira Sans", system-ui, sans-serif;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--weak);
  border-radius: var(--radius);
  cursor: pointer;
}
.copy:hover { color: var(--text); }
.install p { font-size: 15px; }

/* Docs */
.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}
.docs .group { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 4px; }
.docs .group:first-child { padding-top: 0; }
.docs .menu .group { grid-column: 1 / -1; padding-top: 10px; }
.docs .toc { display: none; }
@media (min-width: 1280px) {
  .docs { max-width: 1280px; grid-template-columns: 220px minmax(0, 760px) 200px; }
  .doc .top .bar { max-width: 1280px; }
  .docs article > h1 + section > p:has(> a[href^="#"]:first-child) { display: none; }
  .docs .toc { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 72px; align-self: start; font-size: 13px; }
  .docs .toc b { font-weight: 600; margin-bottom: 4px; }
  .docs .toc a { color: var(--muted); }
  .docs .toc a:hover { color: var(--text); text-decoration: none; }
}
.docs .menu { display: none; }
.docs .menu summary { cursor: pointer; padding: 8px 12px; border: 1px solid var(--weak); border-radius: var(--radius); background: var(--panel); font-weight: 500; }
.docs .menu nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding-top: 8px; }
.docs .menu a { color: var(--muted); padding: 5px 10px; border-radius: var(--radius); font-size: 15px; }
.docs .menu a[aria-current] { color: var(--link); font-weight: 500; }
.docs aside { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs aside a { color: var(--muted); padding: 5px 10px; border-radius: var(--radius); font-size: 15px; }
.docs aside a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.docs aside a[aria-current] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--link); font-weight: 500; }
.docs article h1 { font-size: 34px; margin-top: 0; letter-spacing: -0.015em; }
.docs article h2 { margin-top: 40px; padding-bottom: 6px; border-bottom: 1px solid var(--weak); }
.docs article h3 { margin-top: 28px; }
.docs table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.docs td { border: 1px solid var(--weak); padding: 6px 10px; vertical-align: top; }
.docs thead td { font-weight: 600; background: var(--hover); }
.docs img { max-width: 100%; }
.docs article { min-width: 0; overflow-wrap: break-word; }
.docs article a, .docs article :not(pre) > code { overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--weak); }
.pager a { display: flex; flex-direction: column; font-weight: 500; }
.pager a::before { color: var(--muted); font-size: 13px; font-weight: 400; }
.pager a[rel=prev]::before { content: "← Previous"; }
.pager a[rel=next] { margin-left: auto; text-align: right; }
.pager a[rel=next]::before { content: "Next →"; }
.docs blockquote { margin: 0 0 16px; padding: 2px 16px; border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--bg)); border-radius: 0 var(--radius) var(--radius) 0; }

@media (max-width: 860px) {
  .feature, .org { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 80px; }
.feature.flip { grid-template-columns: minmax(0, 1fr); }
  .feature.flip > div { order: 0; }
}
@media (max-width: 600px) {
  .frame-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px 12px; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .frame { width: 480px; }
  .hint { display: block; }
  .feature.wide picture { overflow-x: auto; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .feature.wide img { width: 640px; max-width: none; }
  .feature > .hint { margin-top: -20px; }
  .feature picture:has(> img.narrow) { justify-self: center; }
  .copy, .switch label, .bar nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .copy { top: 0; right: 0; padding: 0 14px; border: 0; background: none; }
  .cmd pre { margin-right: 0; padding-top: 44px; }
}
@media (max-width: 500px) {
  .org pre { font-size: 12px; padding: 14px; }
  .integrations a { padding: 8px 14px; font-size: 15px; gap: 8px; white-space: nowrap; }
  .prebeta .long { display: none; }
}
@media (max-width: 760px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs aside { display: none; }
  .docs .menu { display: block; }
  .hero { padding-top: 56px; }
  .bar nav { gap: 14px; }
  footer.bar { flex-wrap: wrap; }
  footer.bar nav { flex-wrap: wrap; }
  .bar nav a[href="#features"] { display: none; }
}
