:root {
  --background: #1c1d20;
  --surface: #27292c;
  --foreground: #f2f1ed;
  --muted: #b0b2b6;
  --accent: #deddd9;
  --border: #45474b;
  --font-display: "Trebuchet MS", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "DejaVu Sans Mono", monospace;
  --page-max: 1160px;
  --section-gap: 5rem;
  --radius: 8px;
  color-scheme: dark;
  scrollbar-color: var(--muted) var(--background);
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-body); line-height: 1.75; }
::selection { background: var(--accent); color: var(--background); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--foreground); }
a:active { opacity: .8; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
.site-shell { max-width: var(--page-max); margin: auto; padding: 0 36px; }
.site-header { display: flex; align-items: center; gap: 40px; min-height: 116px; border-bottom: 1px solid var(--border); }
.wordmark { font-family: var(--font-display); font-size: 32px; letter-spacing: -2px; font-weight: 700; color: var(--foreground); text-decoration: none; }
.wordmark span { color: var(--accent); }
nav { display: flex; gap: 30px; margin-left: auto; }
nav a, .header-link { color: var(--muted); font-size: 14px; text-decoration: none; padding: 10px 0; }
nav a[aria-current] { color: var(--foreground); border-bottom: 2px solid var(--accent); }
.header-link { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; }
.header-link:hover { background: var(--surface); border-color: var(--accent); }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; background: var(--foreground); color: var(--background); padding: 8px 18px; }
.skip-link:focus { top: 16px; }
.breadcrumbs { color: var(--muted); font-family: var(--font-mono); font-size: 12px; margin: 36px 0 0; }
.breadcrumbs a { color: var(--muted); }
.home .breadcrumbs { display: none; }
.page-content { max-width: 760px; margin: 44px 0 100px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; font-weight: 700; }
h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -3px; margin: 0 0 30px; overflow-wrap: anywhere; }
h2 { font-size: 30px; letter-spacing: -1px; margin: 64px 0 20px; }
h3 { font-size: 23px; margin: 36px 0 16px; }
p { margin: 0 0 24px; }
.page-content > div > p:first-of-type { font-size: 21px; color: var(--muted); line-height: 1.65; }
ul, ol { padding-left: 24px; }
li { padding-left: 4px; margin: 10px 0; }
strong, b { color: var(--foreground); }
code { font-family: var(--font-mono); font-size: .85em; background: var(--surface); padding: 3px 7px; border-radius: 4px; overflow-wrap: anywhere; }
pre { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
pre code { padding: 0; white-space: pre; overflow-wrap: normal; }
blockquote { margin: 32px 0; border-left: 3px solid var(--accent); padding: 8px 0 8px 24px; color: var(--muted); }
img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; }
.home .page-content { max-width: none; margin: 78px 0 96px; }
.home .page-content > div { display: grid; grid-template-columns: 1.15fr .85fr; column-gap: 64px; align-items: start; }
.home h1 { font-size: clamp(90px, 12vw, 152px); letter-spacing: -10px; margin: 0; grid-column: 1; line-height: .94; }
.home .page-content > div > p:first-of-type { grid-column: 1; font-size: 23px; margin: 28px 0; }
.home .page-content > div > p:nth-of-type(2) { grid-column: 1; display: flex; gap: 24px; margin: 0; align-items: center; }
.home .page-content > div > p:nth-of-type(2) a { font-size: 14px; }
.home .page-content > div > p:nth-of-type(2) a:first-child { padding: 12px 22px; color: var(--background); background: var(--accent); border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.home .page-content > div > p:nth-of-type(2) a:first-child:hover { background: var(--foreground); }
.home .page-content > div > p:nth-of-type(3) { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
.home .page-content > div > p:nth-of-type(3) img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--border); }
.home h2, .home ul, .home blockquote, .home .page-content > div > p:nth-of-type(n+4) { grid-column: 1 / -1; }
.home h2 { font-size: 18px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; font-family: var(--font-mono); padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-top: var(--section-gap); }
.home ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.home li:only-child { grid-column: 1 / -1; }
.home li { color: var(--muted); padding: 24px 0; margin: 0; border-bottom: 1px solid var(--border); line-height: 1.7; }
.home li a { display: block; font-size: 22px; line-height: 1.4; color: var(--foreground); text-decoration: none; margin-bottom: 8px; font-weight: 600; }
.home li a::after { content: " ↗"; color: var(--accent); font-size: 17px; }
.home li a[href^="/"]::after { content: " →"; }
.home li a:hover { color: var(--accent); }
.home blockquote { font-size: 25px; max-width: 780px; margin-top: 36px; }
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 52px; display: flex; align-items: start; gap: 56px; }
.site-footer p { font-size: 13px; margin: 4px 0 0; }
.site-footer p span { color: var(--muted); }
.site-footer > div { display: flex; gap: 28px; margin-left: auto; font-size: 13px; padding-top: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--muted); border: 2px solid var(--background); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--foreground); }
::-webkit-scrollbar-thumb:active { background: var(--accent); }
@media (max-width: 800px) {
  .site-shell { padding: 0 24px; }
  .site-header { min-height: 96px; gap: 24px; flex-wrap: wrap; padding: 22px 0; }
  nav { gap: 20px; }
  .header-link { display: none; }
  .home .page-content > div { column-gap: 30px; }
  .home h1 { font-size: clamp(72px, 13vw, 100px); letter-spacing: -.065em; white-space: nowrap; }
  .home .page-content > div > p:first-of-type { font-size: 19px; }
  .home .page-content > div > p:nth-of-type(2) { gap: 16px; flex-wrap: wrap; }
  .site-footer { gap: 24px; flex-wrap: wrap; }
  .site-footer > div { margin-left: 0; width: 100%; }
}
@media (max-width: 600px) {
  .site-shell { padding: 0 20px; }
  .site-header { gap: 16px; }
  .wordmark { font-size: 28px; }
  nav { gap: 16px; font-size: 13px; }
  nav a { font-size: 13px; }
  .home .page-content { margin-top: 50px; }
  .home .page-content > div { display: block; }
  .home h1 { font-size: clamp(72px, 20vw, 112px); letter-spacing: -.065em; }
  .home .page-content > div > p:first-of-type { font-size: 21px; }
  .home .page-content > div > p:nth-of-type(3) { margin-top: 36px; }
  .home .page-content > div > p:nth-of-type(3) img { aspect-ratio: 4 / 5; }
  .home ul { grid-template-columns: 1fr; }
  .home h2 { margin-top: 56px; font-size: 15px; }
  .home blockquote { font-size: 22px; }
  h1 { letter-spacing: -2px; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
@media (forced-colors: active) {
  :root { scrollbar-color: auto; }
  .home .page-content > div > p:nth-of-type(2) a:first-child { border: 1px solid ButtonText; }
}

/* Project covers retain their own branding within the charcoal portfolio. */
.page-content img[src*="-cover."] { width: 100%; max-width: 760px; margin-inline: auto; border: 1px solid var(--border); }
