/*
 * Bulfit public site: the only stylesheet for / and /privacy.
 * No external resources (fonts, images, scripts). Served same-origin, so it works
 * under a Content-Security-Policy that allows only 'self' stylesheets.
 */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #f1efe9;
  --text: #1c1c1a;
  --muted: #55534d;
  --rule: #d9d5cc;
  --link: #1d5c88;
  --accent: #a4741c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1f1f1d;
    --text: #ecebe6;
    --muted: #b4b1a9;
    --rule: #3a3935;
    --link: #8ec5ee;
    --accent: #d4a64a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

@media (min-width: 40em) {
  body {
    font-size: 1.125rem;
  }
}

/* One readable column, about 70 characters wide, 16px side gutter. */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(70ch + 32px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.lang {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}

.lang a {
  padding: 0.25rem 0;
}

.lang-section {
  padding-bottom: 1rem;
}

.lang-section + .lang-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

[id] {
  scroll-margin-top: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.25rem);
  margin: 2rem 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.25rem 0 0.5rem;
}

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

p,
ul,
ol {
  margin: 0 0 1rem;
}

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

li {
  margin: 0.35rem 0;
}

li::marker {
  color: var(--muted);
}

strong {
  font-weight: 650;
}

sub {
  font-size: 0.75em;
  line-height: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
}

.toc {
  background: var(--surface);
  border-radius: 6px;
  padding: 0.75rem 1rem 0.25rem;
  margin: 1.5rem 0 0;
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.toc ol {
  padding-left: 1.5rem;
  font-size: 0.975rem;
}

.toc li {
  margin: 0.2rem 0;
}

.site-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

@media print {
  .lang,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: inherit;
  }
}
