:root {
  color-scheme: light;
  --background: #f7f6f2;
  --text: #343530;
  --heading: #20231f;
  --muted: #6d7068;
  --accent: #913b3b;
  --line: #dedfd7;
  --selection: #ead0d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.85;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; background: var(--background); color: var(--text); }
::selection { background: var(--selection); }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 8px; background: var(--background); }
.skip-link:focus { top: 10px; }
.file-bar { max-width: 1140px; margin: 0 auto; padding: 24px 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.site-name { color: var(--heading); font-weight: 700; text-decoration: none; }
.site-name span, .file-name { color: var(--muted); font-weight: 400; }
.site-controls { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.language-switch { display: flex; gap: 4px; }
.language-switch a, .theme-switch { padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px; font: inherit; color: var(--muted); background: var(--background); text-decoration: none; }
.language-switch a[aria-current="true"] { color: var(--accent); border-color: var(--accent); }
.language-switch a:hover, .theme-switch:hover { color: var(--accent); background: var(--selection); }
.theme-switch { cursor: pointer; }
.file-bar .file-actions { margin-left: 0; }
.file-actions { margin-left: auto; display: flex; gap: 10px; font-size: 11px; }
.download-link { padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; white-space: nowrap; }
.download-link:hover { border-color: var(--accent); background: var(--selection); }
.layout { display: grid; grid-template-columns: 220px minmax(0, 720px); column-gap: 60px; max-width: 1140px; margin: 0 auto; padding: 64px 40px 32px; }
.profile-intro { grid-column: 2; margin-bottom: 28px; }
.profile-intro > p:last-child { color: var(--muted); font-size: 12px; margin-bottom: 0; }
aside { grid-column: 1; grid-row: 1 / span 2; }
aside nav { position: sticky; top: 40px; font-size: 11px; }
.nav-label { color: var(--muted); margin: 0 0 18px; }
nav a { display: block; width: fit-content; padding: 5px 0; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); text-decoration: underline; }
main { grid-column: 2; min-width: 0; }
main:focus { outline: none; }
.profile-photo { float: right; width: 88px; height: 88px; object-fit: cover; margin: 0 0 20px 24px; border: 1px solid var(--line); border-radius: 4px; }
h1, h2, h3 { color: var(--heading); font-weight: 600; line-height: 1.4; scroll-margin-top: 2rem; }
h1 { font-size: 36px; letter-spacing: -1.5px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 58px 0 24px; letter-spacing: -.4px; }
h3 { font-size: 14px; margin: 32px 0 10px; }
.heading-marker { color: var(--accent); font-weight: 400; }
h2 .heading-marker, h3 .heading-marker { color: var(--muted); }
h1 + p { color: var(--accent); margin: 0 0 32px; font-size: 13px; }
p { margin: 0 0 18px; }
strong { color: var(--heading); font-weight: 600; }
h3 + p:has(> em:only-child) { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
em { font-style: normal; }
.profile-section p > em:first-child { color: var(--muted); font-size: 12px; }
.profile-section:first-child h2 { margin-top: 0; }
ul { list-style: none; margin: 16px 0; padding: 0 0 0 20px; }
li { position: relative; margin: 0 0 14px; }
li::before { content: "-"; position: absolute; left: -20px; color: var(--muted); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer a { color: var(--muted); text-decoration: none; }
footer .file-actions { flex-basis: 100%; margin-left: 0; }
.redacted { display: inline-block; color: var(--heading); background: var(--heading); border-radius: 2px; line-height: .9; vertical-align: baseline; user-select: none; letter-spacing: -1px; max-width: 100%; overflow: hidden; }
.access-panel { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.access-panel h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: 0; }
.access-panel p, .access-panel label { font-size: 12px; }
.access-panel label { display: block; margin-bottom: 8px; }
.access-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.access-panel input[type="password"], .access-panel button { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; background: var(--background); color: var(--text); }
.access-panel input[type="password"] { flex: 1; min-width: 140px; }
.access-panel button { color: var(--accent); border-color: var(--accent); cursor: pointer; }
.access-panel button:hover { background: var(--selection); }
.access-error { color: var(--accent); }
.access-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 28px; padding-bottom: 16px; }
.access-status h2 { margin: 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.access-status button { padding: 0; border: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.access-status .access-error { flex-basis: 100%; margin: 0; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #191c1a;
    --text: #c1c5bd;
    --heading: #e6e9e1;
    --muted: #959c91;
    --accent: #da9494;
    --line: #373c35;
    --selection: #573737;
  }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #191c1a;
    --text: #c1c5bd;
    --heading: #e6e9e1;
    --muted: #959c91;
    --accent: #da9494;
    --line: #373c35;
    --selection: #573737;
}

@media (max-width: 900px) {
  .layout { display: flex; flex-direction: column; max-width: 800px; padding-top: 40px; gap: 28px; }
  .profile-intro { margin-bottom: 0; }
  aside nav { position: static; display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 4px; }
  .nav-label { width: 100%; margin-bottom: 6px; }
  aside { padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
}

@media (max-width: 540px) {
  :root { font-size: 13px; }
  .file-bar { padding: 18px 22px; }
  .layout { padding: 28px 22px; }
  .profile-photo { width: 64px; height: 64px; margin-left: 16px; }
  h1 { font-size: 29px; letter-spacing: -1px; }
  h2 { font-size: 17px; margin-top: 44px; }
  h3 { font-size: 13px; }
  p, li { overflow-wrap: anywhere; }
}

@page {
  size: A4;
  margin: 16mm 18mm 18mm;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 8pt;
    color: #777;
  }
}

@media print {
  :root, :root[data-theme] { color-scheme: light; --background: #fff; --text: #222; --heading: #000; --muted: #555; --accent: #333; --line: #ccc; font-size: 9pt; line-height: 1.5; }
  html { scroll-padding-top: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .file-bar, aside, .skip-link, footer a, .access-panel, .file-actions { display: none; }
  .layout { display: block; max-width: none; padding: 0; }
  .profile-intro { margin-bottom: 6mm; }
  .profile-intro > p:last-child { font-size: 8pt; }
  .profile-section p > em:first-child { font-size: 8pt; }
  .profile-photo { width: 20mm; height: 20mm; margin: 0 0 4mm 6mm; break-inside: avoid; }
  .profile-section { break-inside: avoid-page; }
  h1 { font-size: 24pt; margin: 0 0 2mm; }
  h1 + p { font-size: 10pt; margin-bottom: 6mm; }
  h2 { font-size: 13pt; margin: 7mm 0 3mm; }
  h3 { font-size: 10pt; margin: 5mm 0 2mm; }
  h3 + p:has(> em:only-child) { font-size: 8pt; margin-bottom: 2mm; }
  h1, h2, h3 { break-after: avoid-page; }
  h3 + p:has(> em:only-child), h3 + p:has(> strong:only-child), p:has(> em:only-child) + p:has(> strong:only-child) { break-after: avoid-page; }
  p { margin-bottom: 3mm; }
  ul { margin: 3mm 0; }
  li { margin-bottom: 2mm; break-inside: avoid-page; }
  p, li { orphans: 3; widows: 3; }
  p, li { overflow-wrap: normal; }
  a { text-decoration: none; }
  .redacted { background: #000; color: #000; }
  footer { margin-top: 6mm; padding-top: 3mm; font-size: 8pt; break-inside: avoid-page; }
}
