/* Bruny docs, in the look of the new bruny.dev design (Figtree, indigo on sand). */
:root {
  --ink: #15132E;
  --muted: #4A4766;
  --sand: #F6F3EC;
  --card: #FFFFFF;
  --accent: #392BED;
  --mist: #C7C3FA;
  --line: rgba(21, 19, 46, .1);
  --orange: #F08A4B;
  --ease: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 17px/1.55 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
code, pre, kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Top bar: logo on the left, site links in the middle, sign-in on the right. */
.top {
  max-width: 1200px; margin: 0 auto; padding: 24px 32px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  position: relative; z-index: 5;
}
.top .logo { justify-self: start; display: flex; align-items: center; }
.top .logo img { height: 40px; width: auto; display: block; margin-left: -16px; }
.top .links { display: flex; align-items: center; justify-content: center; gap: 32px; font-size: 16px; font-weight: 500; }
.top .links.end { justify-content: flex-end; gap: 24px; }
.navlink { color: var(--muted); text-decoration: none; transition: color 150ms ease; }
.navlink:hover { color: var(--ink); }
.navlink[aria-current="page"] { color: var(--ink); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border: 2px solid transparent; border-radius: 10px;
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: transform 160ms var(--ease), background-color 150ms ease, color 150ms ease, border-color 150ms ease, filter 150ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary, .btn-primary:hover, .btn-primary:focus-visible { background: var(--accent); color: #fff; }
/* On the dark code blocks. */
.btn-ghost { background: transparent; color: var(--sand); border-color: var(--mist); }
.code .btn { font-family: Figtree, system-ui, sans-serif; }
.code button:focus-visible { outline-color: var(--sand); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { filter: brightness(1.15); }
  .btn-ghost:hover { background: var(--sand); color: var(--ink); border-color: var(--sand); }
}

.menu-btn, .mobile-menu { display: none; }

/* Page */
.layout {
  max-width: 1200px; margin: 0 auto; padding: 48px 32px 120px;
  display: flex; gap: 72px; align-items: flex-start;
}
.side {
  flex: 0 0 220px; position: sticky; top: 24px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
}
.side p { margin: 0 0 8px 12px; font-size: 15px; font-weight: 700; }
.side a {
  display: block; padding: 7px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 16px; line-height: 1.4; transition: color 150ms ease;
}
.side a:hover { color: var(--ink); }
.side a[aria-current="true"] { background: var(--card); color: var(--ink); font-weight: 600; }

main { flex: 1 1 560px; min-width: 0; max-width: 780px; }
h1 { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 800; }
.lede { margin: 20px 0 0; font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 40ch; }
section { padding-top: 24px; }
section + section { margin-top: 56px; }
h2 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; }
h3 { margin: 36px 0 0; font-size: 20px; font-weight: 700; }
main p, main li { font-size: 18px; }
main p { margin: 12px 0 0; }
main ul, main ol { margin: 12px 0 0; padding-left: 22px; }
main li + li { margin-top: 6px; }
.muted { color: var(--muted); }

.ic { font-size: 15px; background: var(--card); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* Code */
.code { margin-top: 16px; background: var(--ink); color: var(--sand); border-radius: 14px; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 0 20px; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--mist);
}
.code pre { margin: 0; padding: 10px 20px 20px; font-size: 15px; line-height: 1.7; white-space: pre; overflow-x: auto; }
.code .pr { color: var(--orange); user-select: none; }
.code .c { color: var(--mist); }
.copy { min-width: 92px; }
.copy .pop { display: inline-block; animation: pop 260ms var(--ease); }
@keyframes pop { from { opacity: .3; transform: scale(.88); } }

/* Tabs */
[role="tablist"] { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 32px; }
.tab {
  all: unset; box-sizing: border-box; cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; font-size: 17px; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; transition: color 150ms ease, border-color 200ms var(--ease), transform 160ms var(--ease);
}
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(.97); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[role="tabpanel"] { margin-top: 24px; animation: panelIn 240ms var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } }

.steps { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-direction: column; gap: 28px; counter-reset: step; }
.steps > li { counter-increment: step; }
.steps > li > .title { margin: 0; font-weight: 600; }
.steps > li > .title::before { content: counter(step) ". "; }

/* Term lists */
dl.terms { margin: 28px 0 0; display: flex; flex-direction: column; gap: 20px; }
dl.terms > div { display: flex; flex-wrap: wrap; gap: 4px 24px; }
dl.terms dt { flex: 0 0 250px; font-family: 'JetBrains Mono', monospace; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
dl.terms dd { margin: 0; flex: 1 1 300px; font-size: 17px; line-height: 1.55; }
dl.terms.narrow dt { flex-basis: 170px; }

.note {
  margin-top: 20px; background: var(--card); border-radius: 16px; padding: 20px 24px;
  font-size: 17px;
}
.note p { margin: 0; font-size: 17px; }
.note p + p { margin-top: 8px; }

table { margin-top: 24px; width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.5; }
th { text-align: left; padding: 0 24px 12px 0; font-weight: 700; }
td { padding: 10px 24px 10px 0; vertical-align: top; }
td code { font-size: 14px; white-space: nowrap; }

.foot {
  max-width: 1200px; margin: 0 auto; padding: 0 32px 56px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; font-size: 16px; color: var(--muted);
}
.foot p { margin: 0; }

@media (max-width: 900px) {
  .side { display: none; }
}
@media (max-width: 760px) {
  .top { padding: 20px; display: flex; justify-content: space-between; }
  .top .links { display: none; }
  .menu-btn {
    all: unset; box-sizing: border-box; display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 6px; width: 48px; height: 48px; border-radius: 12px; cursor: pointer;
    transition: background-color 150ms ease, transform 160ms var(--ease);
  }
  .menu-btn:active { transform: scale(.94); }
  .menu-bar { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 240ms var(--ease); }
  .menu-btn[aria-expanded="true"] { background: rgba(21, 19, 46, .08); }
  .menu-btn[aria-expanded="true"] .menu-bar:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-bar:last-child { transform: translateY(-4px) rotate(-45deg); }
  .mobile-menu {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 12px; right: 12px;
    padding: 12px 20px 20px; background: var(--ink); border-radius: 20px; box-shadow: 0 24px 48px rgba(21, 19, 46, .3);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top right;
    transition: opacity 180ms ease-out, transform 220ms var(--ease), visibility 0s linear 220ms;
  }
  .mobile-menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity 180ms ease-out, transform 220ms var(--ease), visibility 0s; }
  .mobile-menu a:not(.btn) { display: flex; align-items: center; min-height: 52px; font-size: 22px; font-weight: 600; color: var(--sand); text-decoration: none; }
  .mobile-menu .btn { margin-top: 16px; min-height: 56px; font-size: 18px; background: var(--sand); color: var(--ink); }

  .layout { padding: 32px 20px 96px; }
  h1 { font-size: 40px; }
  h2 { font-size: 24px; }
  main p, main li { font-size: 17px; }
  [role="tablist"] { gap: 24px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; font-size: 16px; }
  .code pre { font-size: 13px; padding: 8px 16px 16px; }
  .code-head { padding-left: 16px; }
  dl.terms > div { flex-direction: column; gap: 2px; }
  dl.terms dt, dl.terms dd { flex: 0 0 auto; }
  table { display: block; overflow-x: auto; }
  .foot { padding: 0 20px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
