/* Theme follows the browser preference; no JavaScript or stored setting is needed. */
:root {
  color-scheme: light dark;
  --background: #f7f8f5;
  --surface: #edf1eb;
  --text: #24332b;
  --body-text: #3d4c42;
  --muted: #5c6b62;
  --accent: #285f4d;
  --accent-hover: #1b4738;
  --accent-soft: #e5eee7;
  --border: #dbe2da;
  --selection: #d4e5d7;
  --page-gutter: clamp(1.25rem, 5vw, 2rem);
  --site-width: 64rem;
  --content-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #151b18;
    --surface: #1e2721;
    --text: #e9eee9;
    --body-text: #c1cdc4;
    --muted: #a0afa4;
    --accent: #a0d4b4;
    --accent-hover: #c2e8ce;
    --accent-soft: #253d2e;
    --border: #344138;
    --selection: #375840;
  }
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
.page-content a[href^="tel:"] { white-space: nowrap; }

.wide {
  width: min(var(--site-width), calc(100% - 2 * var(--page-gutter)));
  margin-inline: auto;
}

.site-header, .site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  gap: 1.5rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.site-brand { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.site-identity { min-width: 0; }
.site-header p, .site-footer p { margin: 0; }

.brand-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: var(--background);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
}

.site-title { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1.4; }
.site-title a { color: var(--text); text-decoration: none; }
.site-title a:hover { color: var(--accent); }
.site-tagline { color: var(--muted); font-size: 0.8125rem; line-height: 1.7; }

.site-navigation { font-size: 0.875rem; font-weight: 550; }
.site-navigation ul { display: flex; flex-wrap: wrap; gap: 0.375rem; list-style: none; padding: 0; margin: 0; }
.site-navigation a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.site-navigation a:hover { background: var(--surface); color: var(--text); }
.site-navigation a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.site-navigation a[aria-current="page"]::before {
  content: "";
  width: 0.3125rem;
  height: 0.3125rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

.content {
  flex: 1;
  width: min(var(--content-width), calc(100% - 2 * var(--page-gutter)));
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(4rem, 8vw, 7rem);
}

.page-header { margin-bottom: 2.25rem; }
.page-header::before {
  content: "";
  display: block;
  width: 2rem;
  height: 0.1875rem;
  margin-bottom: 1.5rem;
  border-radius: 999px;
  background: var(--accent);
}

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 650; line-height: 1.3; }
h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 4.25rem); letter-spacing: -0.055em; line-height: 1.08; }
h2 { font-size: 1.625rem; letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
h4 { font-size: 1.125rem; letter-spacing: -0.015em; }
h5, h6 { font-size: 1rem; }

.page-content { color: var(--body-text); overflow-wrap: anywhere; }
.page-content > * { margin-top: 1.375rem; margin-bottom: 0; }
.page-content > :first-child { margin-top: 0; }
.page-content > p:first-child { color: var(--text); font-size: 1.125rem; line-height: 1.8; letter-spacing: -0.01em; }
.page-content > :is(h2, h3) { margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.page-content > :is(h4, h5, h6) { margin-top: 2rem; }
.page-content > :is(h2, h3, h4, h5, h6) + * { margin-top: 1rem; }
.page-content strong { color: var(--text); font-weight: 650; }
.page-content p > em { color: var(--muted); }
.page-content :is(ul, ol) { padding-left: 1.375rem; }
.page-content li { padding-left: 0.25rem; }
.page-content li + li { margin-top: 0.375rem; }
.page-content li::marker { color: var(--accent); }
.page-content img { display: block; max-width: 100%; height: auto; border-radius: 0.5rem; }
.page-content blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 2px solid var(--accent); color: var(--muted); }
.page-content blockquote > :first-child { margin-top: 0; }
.page-content code { padding: 0.15em 0.35em; border-radius: 0.25rem; background: var(--surface); font-size: 0.875em; }
.page-content pre { overflow-x: auto; padding: 1.25rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); }
.page-content pre code { padding: 0; background: none; }
.page-content hr { margin-block: 2.5rem; border: 0; border-top: 1px solid var(--border); }

.site-footer {
  gap: 0.75rem 1.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.7;
}
.site-footer .site-title { font-size: 0.8125rem; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--accent); }

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link:focus {
  top: 0.75rem;
  left: var(--page-gutter);
  z-index: 1;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  clip-path: none;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 40rem) {
  .site-header { gap: 1.25rem; padding-block: 1.25rem; }
  .site-navigation, .site-navigation ul { width: 100%; }
  .site-navigation li { flex: 1; }
  .site-footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 160ms ease, background-color 160ms ease; }
}

@media (forced-colors: active) {
  .brand-mark, .site-navigation a[aria-current="page"] { border: 1px solid currentColor; }
}
