/* Shared navigation, page width, and quiet terrain for secondary pages. */
:root {
  color-scheme: light;
  --page: #ffffff;
  --bg: #ffffff;
  --text: #202124;
  --ink: #202124;
  --body: #454644;
  --muted: #686966;
  --line: rgba(32, 33, 36, 0.11);
  --soft: #f5f5f3;
  --link: #202124;
  --focus: #6256d9;
  --teal: #527a68;
  --amber: #a86c49;
  --shell-contour-filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b0c0e;
    --bg: #0b0c0e;
    --text: #eeeeea;
    --ink: #eeeeea;
    --body: #d6d6d2;
    --muted: #aaa9a4;
    --line: rgba(238, 238, 234, 0.11);
    --soft: #15171a;
    --link: #eeeeea;
    --focus: #9b8cff;
    --teal: #9fbbad;
    --amber: #d6a07f;
    --shell-contour-filter: none;
  }
}

body.site-page {
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.site-page::before {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url('/assets/topography/phoenix.svg') center / cover no-repeat;
  filter: var(--shell-contour-filter);
  opacity: 0.1;
  mask-image: linear-gradient(to right, #000, transparent calc(50% - min(580px, 43vw)), transparent calc(50% + min(580px, 43vw)), #000);
}

.site-page .page,
.site-page .blog-shell {
  width: min(720px, calc(100% - 96px));
  margin-inline: auto;
  padding-top: 34px;
}

.site-page .topbar,
.site-page .site-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.site-page .site-nav {
  grid-column: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 0 0 0 auto;
  font: 13px/1.4 Arial, Helvetica, sans-serif;
}

.site-page .site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-page .site-nav a:hover,
.site-page .site-nav a[aria-current='page'] {
  color: var(--text);
}

.site-page .site-nav a:focus-visible,
.site-page .back-home:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

.site-page .back-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: 13px/1.4 Arial, Helvetica, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.site-page .back-home svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-page .topbar + main { margin-top: 48px; }
.site-page .setup-drawing img { color-scheme: light dark; }

@media (max-width: 620px) {
  .site-page .page,
  .site-page .blog-shell {
    width: calc(100% - 40px);
    padding-top: 24px;
  }

  .site-page .topbar,
  .site-page .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
  }

  .site-page .site-nav {
    justify-content: flex-start;
    gap: 12px 22px;
    margin-left: 0;
  }

  .site-page .topbar + main { margin-top: 38px; }
}

@media print {
  :root {
    --page: #ffffff;
    --bg: #ffffff;
    --text: #111111;
    --ink: #111111;
    --body: #222222;
    --muted: #444444;
    --line: #cccccc;
    --soft: #f4f4f4;
  }

  body.site-page::before,
  .site-page .topbar,
  .site-page .site-header { display: none; }

  .site-page .page,
  .site-page .blog-shell { width: 100%; padding-top: 0; }
  .site-page .setup-drawing img { color-scheme: light; }
}
