/* Values from the Latana design system (tokens.css); keep the names so a token change is easy to carry over. */
@font-face {
  font-family: 'Mulish';
  src: url('/docs/assets/Mulish-Variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --surface: #ffffff;
  --surface-subtle: #f8f8fd;
  --ink: #141414;
  --ink-muted: #475467;
  --accent-strong: #4e20d0;
  --card-tint: #f3ecff;
  --border: #ebe2fd;
  --focus-ring: #8f50ff;
  --shadow-card: 0 2px 12px rgba(16, 24, 40, 0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --font-sans: 'Mulish', 'Avenir Next', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  font: 400 16px/24px var(--font-sans);
  color: var(--ink-muted);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 16px;
  background: var(--surface);
  font-weight: 600;
}

.skip:focus {
  top: 16px;
}

/* Header and footer */

.top {
  border-bottom: 1px solid var(--border);
}

.top-inner,
.layout,
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
}

.brand span {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font: 600 18px/28px var(--font-sans);
  color: var(--ink);
}

.app {
  font: 600 14px/20px var(--font-sans);
  text-decoration: none;
}

.app:hover {
  text-decoration: underline;
}

footer {
  margin-top: 96px;
  padding: 32px 0;
  background: var(--surface-subtle);
  font: 400 14px/20px var(--font-sans);
}

/* Layout */

.layout {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  gap: 64px;
  padding-top: 48px;
}

nav {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

nav a {
  font: 600 14px/20px var(--font-sans);
  color: var(--ink-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

nav a:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

nav a[aria-current='page'] {
  color: var(--accent-strong);
  background: var(--card-tint);
}

main {
  flex: 1;
  min-width: 0;
  max-width: 760px;
}

/* Text */

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 800;
}

h1 {
  font-size: 40px;
  line-height: 52px;
  margin: 0 0 16px;
}

h1 + p {
  font-size: 18px;
  line-height: 27px;
}

h2 {
  font-size: 26px;
  line-height: 34px;
  margin: 56px 0 16px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 20px;
  line-height: 28px;
  margin: 32px 0 8px;
}

h2 + h3 {
  margin-top: 24px;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

li + li {
  margin-top: 8px;
}

strong {
  color: var(--ink);
  font-weight: 700;
}

.anchor {
  margin-left: 8px;
  color: var(--border);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
  color: var(--accent-strong);
}

/* Code */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--ink);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding-right: 80px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 22px;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font: 600 12px/16px var(--font-sans);
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

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

@media (hover: none) {
  .copy {
    opacity: 1;
  }
}

/* Tables */

table {
  width: 100%;
  margin: 8px 0 24px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

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

th {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--ink-muted);
}

td:first-child {
  color: var(--ink);
  white-space: nowrap;
}

td:first-child code {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Overview cards */

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

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--ink-muted);
  text-decoration: none;
  transition: box-shadow 0.15s ease-out;
}

.card strong {
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
}

.card:hover {
  box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.12), 0 4px 6px -2px rgba(16, 24, 40, 0.05);
}

.card:hover strong {
  color: var(--accent-strong);
}

/* Small screens */

@media (max-width: 760px) {
  .top-inner,
  .layout,
  .footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .top-inner {
    height: 64px;
  }

  .brand img {
    height: 28px;
  }

  .layout {
    flex-direction: column;
    gap: 24px;
    padding-top: 24px;
  }

  nav {
    flex: none;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 32px;
    line-height: 40px;
  }

  h2 {
    margin-top: 40px;
    padding-top: 32px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  td:first-child {
    white-space: normal;
  }
}
