/* Tokens taken from ouro-t3 (app/core.css, components/custom): neutral scale,
   blue accent, 0.625rem radius. System fonts, so the pages work offline. */
:root {
  --background: #fafafada;
  --surface: #ffffff;
  --foreground: #171717;
  --muted: #525252;
  --border: #e5e5e5;
  --code: #f5f5f5;
  --accent: #2563eb;
  --must: #CD1515;
  --radius: 0.625rem;
  color-scheme: light;
}

/* Dark palette: a warm charcoal, never pure black. It follows the system
   setting unless the reader picks a theme with the button of the sidebar. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #18181b;
    --surface: #202024;
    --foreground: #e6e6e8;
    --muted: #a1a1aa;
    --border: #35353c;
    --code: #2a2a31;
    --accent: #7aa7f8;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --background: #18181b;
  --surface: #202024;
  --foreground: #e6e6e8;
  --muted: #a1a1aa;
  --border: #35353c;
  --code: #2a2a31;
  --accent: #7aa7f8;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

header.top .name {
  font-weight: 700;
  font-size: 1.125rem;
}

nav.lang a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.75rem;
  background: var(--surface);
}

nav.lang a[aria-current="true"] {
  color: var(--foreground);
  font-weight: 600;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.5rem;
  margin: 3rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.5rem;
}

p.lead {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0 0 1.5rem;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--code);
  border-radius: 0.375rem;
  padding: 0.1rem 0.35rem;
}

pre {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.card.tip {
  border: 2px solid var(--accent);
}

.card.must {
  border: 2px solid var(--must);
}


table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: 0.9375rem;
}

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

th {
  background: var(--code);
}

ol.steps {
  padding-left: 1.25rem;
}

ol.steps > li {
  margin: 0.5rem 0;
}

dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

dd {
  margin: 0.25rem 0 0 0;
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
}

aside.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 1.25rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

aside.side .brand {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

aside.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

aside.side li a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

aside.side li a:hover {
  background: var(--code);
  color: var(--foreground);
}

aside.side li a[aria-current="page"] {
  background: var(--code);
  color: var(--foreground);
  font-weight: 600;
}

img {
  border: 1px solid #FF4D00;
  border-radius: 5px;
}

.lang {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 2rem;
}

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

nav.pager a {
  display: flex;
  flex-direction: column;
  max-width: 50%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  text-decoration: none;
  font-weight: 600;
}

nav.pager a span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

nav.pager a.next {
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
}

aside.side .brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

aside.side .brand img {
  width: 2rem;
  height: 2rem;
}

aside.side .brand .repo {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

aside.side .brand .repo:hover {
  color: var(--foreground);
}

button.theme {
  width: 100%;
  margin-top: 1rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

button.theme:hover {
  background: var(--code);
}

@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }

  aside.side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
