:root {
  color-scheme: dark;
  --bg: #09090b;
  --paper: #18181b;
  --line: #27272a;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --soft: #d4d4d8;
  --accent: #e8a54b;
  --accent-ink: #1c1408;
  --sidebar: 15.5rem;
  --header: 3.5rem;
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 165, 75, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(39, 39, 42, 0.5), transparent);
  background-attachment: fixed;
}

::selection {
  background: rgba(232, 165, 75, 0.35);
  color: #fafafa;
}

a { color: var(--accent); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  z-index: 50;
  text-decoration: none;
  font-weight: 600;
}

.skip:focus { transform: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.1rem;
  background: rgba(9, 9, 11, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.word {
  font-family: "Familjen Grotesk", Inter, sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.product {
  color: var(--muted);
  font-size: 0.92rem;
}

.app-link {
  margin-left: auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
}

.app-link:hover { background: rgba(232, 165, 75, 0.08); }

.menu {
  display: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  color: var(--soft);
  cursor: pointer;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--header));
}

.sidebar {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
  padding: 1rem 0.85rem 2rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.nav-label {
  margin: 1.1rem 0.7rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-label:first-child { margin-top: 0.2rem; }

.sidebar a {
  display: block;
  color: var(--soft);
  text-decoration: none;
  border-radius: 6px;
  padding: 0.38rem 0.7rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.sidebar a:hover { background: rgba(255, 255, 255, 0.04); }

.sidebar a[aria-current="page"] {
  color: var(--accent);
  background: rgba(232, 165, 75, 0.12);
}

main {
  padding: 2.4rem 2.6rem 4rem;
  max-width: 48rem;
}

main.home { max-width: 52rem; }

h1, h2, h3 {
  font-family: "Familjen Grotesk", Inter, sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.kicker {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

main.home h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  max-width: 14ch;
  letter-spacing: -0.035em;
}

h2 {
  margin: 2.2rem 0 0.6rem;
  font-size: 1.35rem;
}

h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.05rem;
}

p, li { line-height: 1.65; }

p { margin: 0.75rem 0; }

.lede {
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 40rem;
}

ul, ol { padding-left: 1.2rem; }

li + li { margin-top: 0.35rem; }

code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

pre {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  overflow: auto;
  line-height: 1.5;
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.86rem;
}

.callout {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: rgba(232, 165, 75, 0.06);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.cards a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem 1.05rem;
}

.cards a:hover { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); }

.cards strong {
  font-family: "Familjen Grotesk", Inter, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cards span { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.cards .lead-card a {
  background: rgba(232, 165, 75, 0.06);
  border-color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--text);
  max-width: 46%;
}

.pager a:last-child { text-align: right; margin-left: auto; }

.pager span {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pager strong { font-weight: 550; color: var(--accent); }

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

@media (max-width: 900px) {
  .menu { display: inline-flex; }

  .shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    z-index: 30;
    top: var(--header);
    bottom: 0;
    left: 0;
    width: min(18rem, 86vw);
    height: auto;
    transform: translateX(-105%);
    border-right: 1px solid var(--line);
  }

  .nav-toggle:checked ~ .shell .sidebar { transform: none; }

  .backdrop { display: none; }

  .nav-toggle:checked ~ .backdrop {
    display: block;
    position: fixed;
    z-index: 20;
    inset: var(--header) 0 0 0;
    background: rgba(0, 0, 0, 0.55);
  }

  main { padding: 1.5rem 1.15rem 3rem; }

  .app-link { padding-inline: 0.55rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: transform 160ms ease; }
  main.home {
    animation: rise 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
