:root,
html[data-theme="light"] {
  --bg: var(--brik-bg, #fcfefb);
  --fg: var(--brik-fg, #181a22);
  --muted: var(--brik-muted, #898d9a);
  --field: var(--brik-field, #f6f7f8);
  --line: var(--brik-line, #ececee);
}

html[data-theme="dark"] {
  --bg: var(--brik-bg, #02040a);
  --fg: var(--brik-fg, #e7e5eb);
  --muted: var(--brik-muted, #767287);
  --field: var(--brik-field, #0e1117);
  --line: var(--brik-line, #1b1d24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  min-height: 100vh;
  font: 16px/1.5 "IBM Plex Sans", Helvetica, Arial, sans-serif;
}

brik {
  display: contents;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  overflow-x: clip;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img {
  display: block;
}

.nav-links {
  color: var(--muted);
}

.nav-links a:hover,
.brand:hover {
  color: var(--fg);
  text-decoration: none;
}

.theme {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.theme svg {
  display: block;
  margin: auto;
}

.hero {
  min-height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0 6rem;
}

.hero img {
  width: 48px;
  height: 48px;
  margin-bottom: 1.75rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.lede {
  margin: 1.25rem 0 0;
  max-width: 26rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.command {
  display: flex;
  align-items: center;
  width: min(36rem, 100%);
  margin-top: 2.25rem;
  background: var(--field);
  border-radius: 0.75rem;
  overflow: hidden;
  text-align: left;
}

.command code {
  flex: 1;
  padding: 0.95rem 1rem;
  font: 0.82rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--fg);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.command code::-webkit-scrollbar {
  display: none;
}

.command button.brik-button.copy {
  flex: none;
  align-self: center;
  margin: 0.35rem;
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.command button.brik-button.copy:focus-visible {
  outline-offset: -2px;
}

button.brik-button.theme {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
}

.hint {
  margin: 0.9rem 0 0;
}

.agent-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.agent {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .agent-box {
    flex-direction: column;
    align-items: stretch;
  }
}

.section {
  padding: 4.5rem 0 0;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2,
.doc h3,
.brik-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.section-head p,
.brik-card > p,
.doc p,
.agent-box p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.grid > * {
  min-width: 0;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  #examples .grid {
    align-items: start;
  }
}

#examples .brik-card {
  min-height: 16rem;
}

#examples .demo {
  min-height: 0;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.demo-actions button {
  margin-top: 0;
}

.demo-code {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 1rem;
}

.demo-code[hidden] {
  display: none;
}

.demo-code pre {
  align-self: stretch;
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  background: var(--bg);
  border-radius: 0.5rem;
  font: 0.8rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.live {
  margin-top: 1.5rem;
}

.live strong {
  display: block;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 600;
}

.tree {
  margin-top: 1.25rem;
  font: 0.84rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tree .row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

.mark {
  color: var(--muted);
}

.tree button {
  margin-top: 0.85rem;
}

.doc {
  display: grid;
  gap: 0.85rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .doc {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2rem;
    align-items: start;
  }
}

.doc pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  background: var(--field);
  border-radius: 0.75rem;
  font: 0.8rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mod {
  min-height: 0;
}

.mod-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.mod-status,
.mod .brik-badge {
  flex: none;
}

.mod-source {
  display: inline-block;
  margin-top: 0.65rem;
  margin-right: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.mod .command {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 1rem;
}

.mod .command code {
  min-width: 0;
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mod .copy {
  margin-top: 0;
}

.theme-demo {
  min-height: 0;
}

.theme-demo .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.theme-demo table {
  margin-top: 0.5rem;
}

.note {
  margin-top: 1.25rem;
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.made {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--fg);
  font-weight: 600;
}

.made img {
  display: block;
  filter: grayscale(1);
  opacity: 0.72;
}

@media (max-width: 640px) {
  .nav-links a {
    display: none;
  }

  .command {
    flex-direction: column;
  }

  .foot {
    flex-direction: column;
  }
}
