:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

html,
body {
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  background: var(--surface-base);
  background-image: var(--bg-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

main {
  position: relative;
  flex: 1 0 auto;
}

p,
ul,
ol,
blockquote,
pre,
table,
figure {
  margin-top: 0;
  margin-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.8rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
}

h3 {
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
}

a {
  color: var(--accent-link);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--nav-link-hover);
}

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

strong {
  color: var(--text-primary);
}

code {
  background: var(--surface-sunken);
  border: var(--border-width) solid var(--surface-border);
  padding: 0.15rem 0.35rem;
  border-radius: calc(var(--radius-base) * 0.66);
  font-size: 0.92em;
}

pre {
  background: var(--surface-sunken);
  border: var(--border-width) solid var(--surface-border);
  border-radius: var(--radius-base);
  padding: 0.85rem 0.9rem;
  overflow-x: auto;
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

blockquote {
  border-left: 3px solid var(--accent-primary);
  margin-left: 0;
  padding: 0.2rem 0 0.2rem 0.8rem;
  color: var(--text-secondary);
}

img {
  max-width: 100%;
  height: auto;
}
