@font-face {
  font-family: DadChessNavigation;
  src: url('/assets/fonts/Manrope-Variable.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --dadchess-site-header-height: 0px;
  --dadchess-nav-width: 204px;
  --dadchess-dock-height: 0px;
}

html:has(body > main[data-startup-content]) { scrollbar-gutter: stable; }
body[data-startup-loading] > main[data-startup-content] { visibility: hidden; opacity: 0; }
body:not([data-startup-loading]) > .site-startup-status { display: none; }
.site-startup-status {
  position: absolute;
  inset: 24px 16px auto;
  margin: 0;
  color: #675881;
  font: 600 14px/1.4 DadChessNavigation, system-ui, sans-serif;
  text-align: center;
}

body:has(> .dadchess-site-header) {
  box-sizing: border-box;
  padding-inline-start: var(--dadchess-nav-width);
  padding-block-end: var(--dadchess-dock-height);
}

.dadchess-site-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: var(--dadchess-nav-width);
  box-sizing: border-box;
  color: #fff;
  background: linear-gradient(155deg, #171634, #201c46);
  font: 400 16px/1.45 system-ui, sans-serif;
}

.dadchess-site-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100%;
  padding: 23px 15px 17px;
  box-sizing: border-box;
}

.dadchess-site-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-inline: 5px;
  color: #fff;
  text-decoration: none;
}
.dadchess-site-brand i { color: #a271fd; font: italic 900 42px/1 system-ui, sans-serif; }
.dadchess-site-brand :is(strong, small) { display: block; }
.dadchess-site-brand strong { font: 700 19px/1.1 system-ui, sans-serif; }
.dadchess-site-brand small { margin-top: 3px; color: #dfd8fa; font: 400 11px/1.45 system-ui, sans-serif; }

.dadchess-site-inner > .dadchess-site-nav { display: flex; flex: 1 1 auto; flex-direction: column; gap: 5px; }
.dadchess-site-inner > .dadchess-site-nav a {
  box-sizing: border-box;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #fff;
  font: 750 13px/1.45 system-ui, sans-serif;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.dadchess-site-inner > .dadchess-site-nav a[data-short-label] > span { line-height: 14px; }
.dadchess-site-inner > .dadchess-site-nav svg {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  padding: 4.5px;
  border-radius: 8px;
  background: #413b62;
}
.dadchess-site-inner > .dadchess-site-nav a[aria-current="page"] {
  background: #5a46db;
  border-color: #7966f1;
}
.dadchess-site-inner > .dadchess-site-nav a[aria-current="page"] svg { background: transparent; }
.dadchess-site-inner > .dadchess-site-nav a:hover:not([aria-current="page"]) { background: rgb(255 255 255 / 8%); }
.dadchess-site-inner :is(a, button):focus-visible { outline: 2px solid #a271fd; outline-offset: 3px; }
.dadchess-site-inner :is(a, button):focus:not(:focus-visible) { outline: none; }

.dadchess-site-actions {
  position: fixed;
  z-index: 5;
  inset: 16px max(16px, env(safe-area-inset-right)) auto auto;
  display: flex;
  align-items: center;
}

.dadchess-mobile-bar, .dadchess-mobile-drawer { display: none; }

@media (min-width: 1024px) {
  .dadchess-site-header { overflow-y: auto; }
}

@media (max-width: 1023px) {
  :root {
    --dadchess-site-header-height: calc(48px + env(safe-area-inset-top, 0px));
    --dadchess-nav-width: 0px;
    --dadchess-dock-height: env(safe-area-inset-bottom, 0px);
  }

  html:has(body > main[data-startup-content]) { scrollbar-gutter: auto; }
  html:has(body > .dadchess-site-header) { scroll-padding-top: var(--dadchess-site-header-height); }
  .site-startup-status { inset-block-start: calc(var(--dadchess-site-header-height) + 24px); }
  .dadchess-site-header {
    position: sticky;
    inset: 0 0 auto;
    z-index: 12;
    width: 100%;
    padding-top: env(safe-area-inset-top, 0px);
    border-bottom: 1px solid #ebe6f1;
    background: #f6f4fb;
    color: #4c4562;
  }

  .dadchess-site-header > .dadchess-site-inner { min-height: 0; padding: 2px 6px; }
  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-brand { display: none; }
  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav a {
    justify-content: center;
    min-height: 44px;
    padding: 0;
    font-size: 11px;
    color: #4c4562;
  }

  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav svg { display: none; }
  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav a[data-short-label] span { display: none; }
  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav a[data-short-label]::after { content: attr(data-short-label); }
  .dadchess-site-header > .dadchess-site-inner > .dadchess-site-nav a[aria-current="page"] {
    border-color: transparent;
    background: #eee8f7;
  }

  .dadchess-mobile-ready > .dadchess-site-inner { display: contents; }
  .dadchess-mobile-ready > .dadchess-site-inner > :is(.dadchess-site-brand, .dadchess-site-nav),
  .dadchess-mobile-original-return { display: none !important; }

  .dadchess-mobile-ready .dadchess-site-actions {
    position: absolute;
    inset: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) auto auto;
    height: 47px;
  }

  .dadchess-mobile-bar {
    position: relative;
    display: flex;
    align-items: center;
    height: 47px;
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
  }

  .dadchess-mobile-title {
    position: absolute;
    inset-inline: 96px;
    overflow: hidden;
    color: #3b354f;
    font-size: 14px;
    font-weight: 650;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
  }

  .dadchess-mobile-bar :is(button, a),
  .dadchess-mobile-panel-heading button {
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .dadchess-mobile-bar :is(button, a):active { background: #eee8f7; }
  :is(.dadchess-mobile-bar, .dadchess-mobile-drawer) :is(button, a):focus-visible {
    outline: 2px solid #9e82ef;
    outline-offset: -2px;
  }

  .dadchess-mobile-drawer[open] {
    position: fixed;
    inset: 0;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: #e1d7f1;
  }

  .dadchess-mobile-drawer::backdrop {
    background: rgb(23 17 43 / 43%);
    animation: dadchess-drawer-dim 190ms ease both;
  }

  .dadchess-mobile-panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(282px, calc(100% - 34px));
    height: 100%;
    padding: calc(23px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
    padding-inline-start: max(14px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 0 22px 22px 0;
    background: linear-gradient(110deg, #191630, #211a43);
    box-shadow: 12px 0 30px rgb(22 13 44 / 22%);
    animation: dadchess-drawer-slide 190ms ease both;
  }

  .dadchess-mobile-panel-heading {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 22px;
  }

  .dadchess-mobile-panel-heading button {
    border: 1px solid #51426e;
    border-radius: 50%;
    background: #342952;
  }

  .dadchess-mobile-links {
    display: grid;
    flex: none;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid #3f345a;
  }

  :is(.dadchess-mobile-links, .dadchess-mobile-project) a {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 48px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #e1d7f1;
    font-size: 15px;
    font-weight: 650;
    text-decoration: none;
  }

  .dadchess-mobile-links a > svg,
  .dadchess-mobile-project-icon {
    box-sizing: border-box;
    flex: none;
    width: 30px;
    height: 30px;
    padding: 5px;
    border-radius: 9px;
    background: #392f56;
  }

  .dadchess-mobile-links a[aria-current="page"] {
    border-color: #8168e6;
    background: linear-gradient(110deg, #624ad5, #503bc4);
    color: #fff;
  }

  .dadchess-mobile-links a[aria-current="page"] svg { background: transparent; }

  .dadchess-mobile-project {
    flex: none;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #463959;
  }

  .dadchess-mobile-project a {
    min-height: 58px;
    border-color: #44365b;
    background: #292041;
  }

  .dadchess-mobile-project-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: #423260;
    color: #d8bfff;
  }

  .dadchess-mobile-project :is(strong, small) { display: block; }
  .dadchess-mobile-project small { color: #cabbdd; font-size: 11px; font-weight: 400; }
  .dadchess-mobile-project a > svg { flex: none; width: 16px; height: 16px; margin-left: auto; color: #ccb9ee; }
  .dadchess-mobile-drawer[data-closing] .dadchess-mobile-panel { animation: dadchess-drawer-slide-out 190ms ease both; }
  .dadchess-mobile-drawer[data-closing]::backdrop { animation: dadchess-drawer-undim 190ms ease both; }
}

@keyframes dadchess-drawer-slide { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes dadchess-drawer-slide-out { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes dadchess-drawer-dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes dadchess-drawer-undim { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dadchess-site-inner > .dadchess-site-nav a { transition: none; }
  .dadchess-mobile-drawer::backdrop, .dadchess-mobile-panel { animation: none; }
}
