/* Sweeteh docs. One stylesheet for the landing page and every docs page. */

:root {
  --bg: #120b0c;
  --bg-raised: #1a1011;
  --bg-sunken: #0c0707;
  --border: #33201f;
  --text: #f3e9e7;
  --text-soft: #b9a5a2;
  --text-faint: #86706d;
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, 0.11);
  --on-accent: #240606;
  --glow: rgba(214, 40, 48, 0.28);

  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --bar: 60px;
  --side: 264px;
  --toc: 216px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fffbfa;
  --bg-raised: #fbf1ef;
  --bg-sunken: #f6e8e6;
  --border: #eed8d5;
  --text: #261415;
  --text-soft: #6d5151;
  --text-faint: #9c8280;
  --accent: #c81e2b;
  --accent-soft: rgba(200, 30, 43, 0.07);
  --on-accent: #ffffff;
  --glow: rgba(200, 30, 43, 0.12);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* nothing on the page selects by accident, only commands and code, which are there to be copied */
body {
  -webkit-user-select: none;
  user-select: none;
}

pre,
code,
input {
  -webkit-user-select: text;
  user-select: text;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

pre,
.table,
.sidebar,
.toc {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.bar-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14.5px;
  font-weight: 500;
}

.bar-link:hover {
  color: var(--text);
  background: var(--bg-raised);
  text-decoration: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  background: var(--bg-raised);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.menu-button {
  display: none;
  margin-left: -8px;
}

:root[data-theme="light"] .icon-moon,
:root:not([data-theme="light"]) .icon-sun {
  display: none;
}

/* ---------- docs layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--toc);
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar,
.toc {
  position: sticky;
  top: var(--bar);
  align-self: start;
  height: calc(100vh - var(--bar));
  overflow-y: auto;
  padding: 28px 16px 40px 24px;
}

.sidebar {
  border-right: 1px solid var(--border);
}

.nav-group + .nav-group {
  margin-top: 24px;
}

.nav-title,
.toc-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-group a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 14.5px;
}

.nav-group a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-group a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

.toc {
  padding: 32px 24px 40px 8px;
}

.toc-title {
  padding: 0 0 0 12px;
}

.toc a {
  display: block;
  padding: 3px 0 3px 12px;
  border-left: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

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

.toc a.sub {
  padding-left: 24px;
}

.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.content {
  min-width: 0;
  padding: 40px 48px 72px;
}

.content > * {
  max-width: 760px;
}

.content > .wide {
  max-width: none;
}

/* ---------- prose ---------- */

h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 32px;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.6;
}

h2 {
  margin: 48px 0 12px;
  padding-top: 4px;
  font-size: 23px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3 {
  margin: 32px 0 8px;
  font-size: 17.5px;
  line-height: 1.4;
  font-weight: 600;
}

h2 .anchor,
h3 .anchor {
  margin-left: 8px;
  color: var(--text-faint);
  font-weight: 400;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
  text-decoration: none;
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--text-faint);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

:not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.code {
  position: relative;
  margin: 0 0 20px;
}

pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  font-size: 14px;
  line-height: 1.65;
}

pre code {
  font-size: inherit;
}

pre .dim {
  color: var(--text-faint);
}

.copy {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-raised);
  color: var(--text-soft);
  font: 500 12.5px var(--font);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.code:hover .copy,
.copy:focus-visible {
  opacity: 1;
}

.copy:hover {
  color: var(--text);
}

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raised);
  font: 500 12.5px/1.7 var(--mono);
  text-align: center;
  white-space: nowrap;
}

kbd + kbd {
  margin-left: 4px;
}

.table {
  margin: 0 0 24px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
}

th {
  padding: 10px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

td.fit {
  width: 1%;
  white-space: nowrap;
}

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

.note {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 15px;
}

.note > :last-child {
  margin-bottom: 0;
}

.note strong {
  display: block;
  margin-bottom: 2px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
}

.pager a {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
}

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

.pager small {
  display: block;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 400;
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

.filter {
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.filter::placeholder {
  color: var(--text-faint);
}

.empty {
  color: var(--text-soft);
}

[hidden] {
  display: none !important;
}

/* ---------- cards, shared by the landing page and docs ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

a.card {
  color: inherit;
}

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

.card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- landing page ---------- */

.home {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* the first thing on the page is the shell itself: the desktop fills a frame, the island works at its top and the name sits at its foot */
.hero {
  position: relative;
  height: min(80vh, 780px);
  min-height: 520px;
  margin: 20px calc(50% - min(660px, 50vw - 16px)) 0;
  overflow: hidden;
  border-radius: 28px;
  background: #1a0708;
  color: #fff;
  animation: frame-in 0.9s var(--ease) both;
}

.hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  /* the clip is there for the feel, soft and a little dim, scaled so the blur has no pale edge */
  filter: blur(3px) brightness(0.82) saturate(1.05);
  transform: scale(1.03);
}

/* a vignette closes in from every side and deepens toward the foot, so the name reads on it */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 2, 3, 0.96) 0%, rgba(10, 2, 3, 0.78) 28%, rgba(10, 2, 3, 0.3) 58%, rgba(10, 2, 3, 0) 80%),
    radial-gradient(120% 90% at 50% 30%, rgba(10, 2, 3, 0) 35%, rgba(10, 2, 3, 0.7) 100%);
  pointer-events: none;
}

.hero h1,
.hero p {
  text-shadow: 0 2px 24px rgba(10, 2, 3, 0.6);
}

.hero-text {
  position: absolute;
  z-index: 1;
  left: clamp(22px, 5vw, 64px);
  right: clamp(22px, 5vw, 64px);
  bottom: clamp(26px, 5vw, 60px);
}

.hero h1 {
  margin: 0 0 14px -0.04em;
  font-size: clamp(56px, 10.5vw, 140px);
  line-height: 0.86;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.hero p {
  max-width: 540px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions a {
  padding: 11px 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(20, 6, 7, 0.35);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15.5px;
  font-weight: 550;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}

.hero-actions a:hover {
  border-color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transform: translateY(-2px);
}

.hero-actions a.primary {
  border-color: #fff;
  background: #fff;
  color: #230809;
}

@keyframes frame-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
}

/* on the landing page the top bar is an island of its own, a pill that floats over the page */
.landing .bar {
  top: 14px;
  width: fit-content;
  max-width: calc(100% - 24px);
  height: 46px;
  margin: 14px auto 0;
  padding: 0 6px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.landing .bar-link,
.landing .icon-button {
  flex-shrink: 0;
}

/* a clip scrolled to from the bar lands in the middle of the screen */
.feature {
  scroll-margin-top: calc(50vh - 200px);
}

@media (max-width: 560px) {
  .landing .bar-link {
    padding: 6px;
    font-size: 13px;
  }

  .landing .icon-button {
    width: 32px;
  }

  .landing .bar a.icon-button {
    display: none;
  }
}

.landing .bar-link,
.landing .icon-button {
  border-radius: 999px;
}

.shot {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-sunken);
}

.shot video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.home section {
  padding: 72px 0 0;
}

.home h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.home .sub {
  max-width: 620px;
  margin: 0 0 28px;
  color: var(--text-soft);
}

.home .code {
  max-width: 760px;
}

.footer {
  margin-top: 88px;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 14px;
  text-align: center;
}

/* ---------- theme preview on the themes page ---------- */

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-soft);
  font: 500 14px var(--font);
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.preview {
  margin: 0 0 24px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--p-bg);
  color: var(--p-text);
  transition: background 0.4s, color 0.4s;
}

.preview-island {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--p-layer1);
  border: 1px solid var(--p-line);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.4s, border-color 0.4s;
}

.preview-island i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-accent);
  transition: background 0.4s;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.preview-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--p-layer2);
  font-size: 14px;
  transition: background 0.4s;
}

.preview-card b {
  display: block;
  font-weight: 600;
}

.preview-card span {
  color: var(--p-soft);
  font-size: 13px;
  transition: color 0.4s;
}

.preview-card.accent {
  background: var(--p-accent);
  color: var(--p-bg);
}

.preview-card.accent span {
  color: inherit;
  opacity: 0.75;
}

.preview-palette {
  display: flex;
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
}

.preview-palette span {
  flex: 1;
  transition: background 0.4s;
}

/* ---------- small screens ---------- */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: var(--side) minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 800px) {
  .bar {
    padding: 0 16px;
  }

  .menu-button {
    display: grid;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: var(--bar) 0 0 0;
    z-index: 15;
    display: none;
    height: auto;
    padding: 20px 16px 40px;
    border-right: 0;
    background: var(--bg);
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .sidebar {
    display: block;
  }

  .content {
    padding: 28px 20px 56px;
  }

  h1 {
    font-size: 29px;
  }

  .hero {
    height: 76vh;
    border-radius: 22px;
  }

  .copy {
    opacity: 1;
  }
}

/* ---------- motion ---------- */
/* everything eases in and settles, nothing bounces. The js class is set before paint, so without scripts nothing is hidden. */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.landing {
  overflow-x: hidden;
}

.docs .content {
  animation: fade 0.45s ease both;
}

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal.seen {
  opacity: 1;
  transform: none;
}

.button,
.card,
.pager a,
.chip {
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, filter 0.25s, box-shadow 0.25s;
}

.button:hover,
a.card:hover,
.pager a:hover {
  transform: translateY(-2px);
}

.home .card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.shot {
  transition: border-color 0.4s, box-shadow 0.4s;
}

.feature .shot:hover {
  border-color: var(--accent);
  box-shadow: 0 24px 60px -30px var(--accent);
}

.nav-group a,
.toc a,
.bar-link,
.icon-button {
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.icon-button svg {
  transition: transform 0.5s var(--ease);
}

.theme-button:hover svg {
  transform: rotate(40deg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- landing page sections ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 48px;
  margin-bottom: 72px;
}

.feature:nth-of-type(even) {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.feature:nth-of-type(even) .feature-text {
  order: 2;
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0 0 14px;
  color: var(--text-soft);
}

.feature ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-soft);
  font-size: 15px;
}

.feature li {
  margin-bottom: 6px;
  padding-left: 18px;
  position: relative;
}

.feature li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.center {
  text-align: center;
}

.center .sub {
  margin-left: auto;
  margin-right: auto;
}

.home .cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.install-box {
  max-width: 760px;
  margin: 0 auto;
}

.hero-text > * {
  animation: rise 0.9s var(--ease) both;
  animation-delay: 0.25s;
}

.hero-text > :nth-child(2) {
  animation-delay: 0.33s;
}

.hero-text > :nth-child(3) {
  animation-delay: 0.41s;
}

/* the command and its button sit side by side in one bar, so the button never covers the text */
.install-box .code {
  display: flex;
  max-width: none;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sunken);
}

.install-box pre {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
}

.install-box .copy {
  position: static;
  flex-shrink: 0;
  padding: 0 22px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-raised);
  color: var(--text);
  font-size: 14px;
  opacity: 1;
  transition: background 0.2s, color 0.2s;
}

.install-box .copy:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.install-box p {
  margin: 0;
  color: var(--text-faint);
  font-size: 14.5px;
  text-align: center;
}

.footer a {
  color: var(--text-soft);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 14px;
}

@media (max-width: 800px) {
  .feature,
  .feature:nth-of-type(even) {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 56px;
  }

  .feature:nth-of-type(even) .feature-text {
    order: 0;
  }
}

/* ---------- icons on the cards ---------- */

.symbol {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.card .symbol {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 24px;
}
