/* Icon variables */
:root {
  --info-icon: url('../icons/info.svg');
  --sun-icon: url('../icons/sun.svg');
  --moon-icon: url('../icons/moon.svg');
  --icon-next: url('../icons/next.svg');

  /* Core color primitives */
  --color-light: #ffffff;
  --color-dark: rgb(28, 28, 30);
  --color-haze: #f2f5f7;
  --color-bubble: rgb(36, 36, 38);

  /* Theme-aware color system using light-dark() */
  --color-bg: light-dark(var(--color-light), var(--color-dark));
  --color-text: light-dark(#141010, #eeeeee);
  --color-text-light: light-dark(#141010, #ffffff);
  --color-accent: light-dark(var(--color-haze), var(--color-bubble));
  --color-overlay: light-dark(var(--color-light), var(--color-bubble));
  --color-border: light-dark(#eeeeee, transparent);
  --color-theme: light-dark(oklch(from #1a5fb4 calc(l * 0.6) calc(c * 1.2) h), #aecfff);
  --color-inline: light-dark(#0369a1, #38bdf8);
  --color-success: light-dark(#059669, #34d399);
  --color-warning: light-dark(#d97706, #fbbf24);

  /* Search-specific colors */
  --color-search-bg: var(--color-accent);
  --color-search-border: light-dark(transparent, var(--color-accent));

  /* Scrollbar colors */
  --color-scroll-thumb: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.06));

  /* Shadow colors */
  --color-shadow-subtle: light-dark(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.15));
  --color-shadow-light: light-dark(rgba(0, 0, 0, 0.17), rgba(0, 0, 0, 0.4));
  --color-shadow-medium: light-dark(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.5));
  --color-shadow-heavy: light-dark(rgba(0, 0, 0, 0.255), rgba(0, 0, 0, 0.6));
  --color-shadow-nav: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));

  /* Syntax highlighting colors */
  --color-syntax-line-number: light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4));
  --color-syntax-error: light-dark(#dc2626, #f87171);
  --color-syntax-keyword: light-dark(#7c3aed, #a78bfa);
  --color-syntax-name: light-dark(oklch(from #1a5fb4 calc(l * 0.8) c h), #38bdf8);
  --color-syntax-name-alt: light-dark(oklch(from #1a5fb4 calc(l * 0.7) c h), #0ea5e9);
  --color-syntax-string: light-dark(oklch(from #1a5fb4 calc(l * 0.6) calc(c * 0.8) calc(h + 120)), #34d399);
  --color-syntax-number: light-dark(oklch(from #1a5fb4 calc(l * 0.6) calc(c * 0.9) calc(h + 180)), #f87171);
  --color-syntax-comment: light-dark(#1a5fb4, #94a3b8);
  --color-syntax-comment-special: light-dark(#d97706, #fbbf24);
  --color-syntax-diff-removed: light-dark(#dc2626, #f87171);
  --color-syntax-diff-added: light-dark(#059669, #34d399);
  --color-text-muted: light-dark(#64748b, #94a3b8);

  /* Code block panel variables */
  --code-panel-timeout: 2250ms;
  --code-panel-animation-delay: 50ms;
  --code-max-height: initial;
  --code-observer-margin: 50px;

  /* Focus management */
  --focus-ring-color: light-dark(#0ea5e9, #38bdf8);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  /* Typography */
  --font-family: 'Metropolis', sans-serif;

  /* Animation */
  --timing-ease: ease;

  /* Icons */
  --icon-next: url(../images/icons/double-arrow.svg);
  --icon-never: url(../images/sitting.svg);

  color-scheme: light dark;

  &[data-mode="dark"] {
    color-scheme: dark only;
    * { box-shadow: none !important; }
  }
  &[data-mode="light"] {
    color-scheme: light only;
  }
  &[data-mode="auto"] {
    @media (prefers-color-scheme: dark) {
      * { box-shadow: none !important; }
    }
  }
}

/* Font Face Declarations */
@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 400;
  src: local('Metropolis Regular'), local('Metropolis-Regular'), 
       url('../fonts/Metropolis-Regular.woff2') format('woff2'), 
       url('../fonts/Metropolis-Regular.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 300;
  src: local('Metropolis Light'), local('Metropolis-Light'), 
       url('../fonts/Metropolis-Light.woff2') format('woff2'), 
       url('../fonts/Metropolis-Light.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  font-style: italic;
  font-weight: 300;
  src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'), 
       url('../fonts/Metropolis-LightItalic.woff2') format('woff2'), 
       url('../fonts/Metropolis-LightItalic.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  font-style: normal;
  font-weight: 500;
  src: local('Metropolis Medium'), local('Metropolis-Medium'), 
       url('../fonts/Metropolis-Medium.woff2') format('woff2'), 
       url('../fonts/Metropolis-Medium.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  font-style: italic;
  font-weight: 500;
  src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'), 
       url('../fonts/Metropolis-MediumItalic.woff2') format('woff2'), 
       url('../fonts/Metropolis-MediumItalic.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'Cookie';
  font-style: normal;
  font-weight: 400;
  src: local('Cookie-Regular'), 
       url('../fonts/cookie-v10-latin-regular.woff2') format('woff2'), 
       url('../fonts/cookie-v10-latin-regular.woff') format('woff');
  font-display: swap;
}

/* Utility classes */
.narrow {
  max-width: 750px;
  margin: 0 auto;
}

/* Layout utilities */
blockquote + code-highlighter {
  margin-top: 2.25rem;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: var(--color-scroll-thumb) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 0.5rem;
}

::-webkit-scrollbar-thumb {
  background: var(--color-scroll-thumb);
  border-radius: 0.25rem;
}

body, html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  font-size: 18px;
}

@keyframes flash {
  0% { opacity: 0; }
  75% { opacity: 0; }
  100% { opacity: 1; }
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  margin: 0 auto;
  position: relative;
  font-kerning: normal;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-overflow-scrolling: touch;
  max-width: 1440px;
  animation: 0.67s flash ease-in;
  @media screen and (min-width: 1640px) {
    max-width: 1600px;
  }
}

/* Typography */
a {
  text-decoration: underline;
  text-decoration-color: var(--color-theme);
  text-underline-offset: 2px;
  color: var(--color-theme);
}

docs-sidebar {
  li ul {
    margin-inline-start: .5em;
  }
}

/* Remove underlines from navigation links */
nav a,
.nav a,
.nav-link,
.pager-link,
docs-sidebar a,
.sidebar-link a {
  text-decoration: none;
  color: inherit;
}

p {
  padding: 0.75rem 0;
  &:empty {
    display: none;
  }
}

li, li p {
  padding: 0.25rem 0;
}

blockquote {
  opacity: 0.8;
  padding: 1rem;
  position: relative;
  quotes: '\201C''\201D''\2018''\2019';
  margin: 0.75rem 0;
  display: flex;
  flex-flow: row wrap;
  background-repeat: no-repeat;
  background-size: 5rem;
  background-position: 50% 50%;
  background-color: var(--color-accent);
  border-radius: 0.25rem;
  overflow: hidden;
  &::before {
    content: "";
    padding: 2px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background: var(--color-theme);
  }
  p {
    padding-left: 0.5rem !important;
    font-size: 1.1rem !important;
    width: 100%;
    font-style: italic;
  }
}


h1, h2, h3, h4, h5 {
  font-family: inherit;
  font-weight: 500;
  padding: 0.33rem 0;
  color: inherit;
  line-height: 1.35;
}

h1 { font-size: 200%; }
h2 { font-size: 175%; }
h3 { font-size: 150%; }
h4 { font-size: 125%; }
h5 { font-size: 120%; }
h6 { font-size: 100%; }

/* Media */
img, svg, figure {
  max-width: 100%;
  vertical-align: middle;
}

img {
  height: auto;
  margin: 1rem auto;
  padding: 0;
}

/* Layout */
main {
  flex: 1;
  @media screen and (min-width: 42rem) {
    padding-bottom: 45px;
  }
}

@media screen and (max-width: 667px) {
  .main > .grid-auto {
    grid-gap: 0;
  }
}


ol, ul {
  list-style: none;
}

b, strong {
  font-weight: 500;
}

hr {
  border: none;
  padding: 1px;
  background: var(--color-border);
  margin: 1rem 0;
}

/* Aside/Sidebar */
.aside {
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: 0.25rem;
  align-self: start;
  max-height: 80vh;
  position: sticky;
  z-index: 9999;
  top: 0;
  padding: 1rem 0;
  @media screen and (min-width: 42rem) {
    padding: 1rem 1.5rem;
    top: 2.5rem;
    margin-top: 1rem;
    padding-top: 0;
  }
  .inner {
    height: 0;
    overflow: hidden;
    @media screen and (min-width: 42rem) {
      height: initial;
    }
  }
  h3 {
    position: relative;
  }

  ul {
    padding: 0;
    list-style: none;
  }

  &.show .inner {
    height: initial;
    overflow: visible;
  }

  .toggle {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    background: var(--color-accent);
    transform: translateY(-1rem);
    display: flex;
    justify-content: space-between;
    @media screen and (min-width: 42rem) {
      display: none;
    }
  }
}

table {
  margin: 1.5rem 0;
  width: 100%;
  thead {
    font-weight: 400;
    text-align: left;
    color: light-dark(var(--dark), var(--light)) !important;
    background: light-dark(
      oklch(from var(--accent) calc(l * (1 - 0.1613)) c h),
      oklch(from var(--accent) calc(l * 1.613) c h)
    );
  }
  tbody tr:nth-child(even) {
    background-color: var(--color-accent) !important;
    box-shadow: 0 1rem 0.75rem -0.75rem var(--color-shadow-subtle);
  }
  th, td {
    padding: 0.5rem;
    font-weight: 400 !important;
  }
  th:not(:first-child), td:not(:first-child) {
    padding-left: 1.5rem;
  }
}

.content {
  ul, ol { padding-left: 1.1rem; }
  ul { list-style: initial; }
  ol { list-style: decimal; }
  a { 
    color: var(--color-theme);
    text-decoration: underline;
    text-decoration-color: var(--color-theme);
    text-underline-offset: 2px;
  }
}

/* Form elements */
::placeholder {
  font-size: 1rem;
}

/* Icons and graphics */
svg.icon-sort {
  fill: var(--color-light);
  height: 0.7rem;
  width: 0.7rem;
  display: inline-block;
  margin-left: auto;
  vertical-align: middle;
}

canvas {
  margin: 2.5rem auto 0 auto;
  max-width: 450px !important;
  max-height: 450px !important;
}

footer {
  min-height: 150px;
}

del {
  opacity: 0.5;
}

/* Back to top button */
#toTop {
  background: transparent;
  outline: 0.5rem solid transparent;
  height: 2rem;
  width: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 0;
  bottom: 2.25rem;
  transform: rotate(45deg) translate(5rem);
  opacity: 0;
  transition: opacity 0.5s var(--timing-ease), transform 0.25s var(--timing-ease);
  z-index: 5;
  &.active {
    right: 1.5rem;
    opacity: 1;
    transform: rotate(45deg) translate(0);
  }
  &::after, &::before {
    position: absolute;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    border-left: 1px solid var(--color-text);
    border-top: 1px solid var(--color-text);
  }
  &::after {
    width: 0.67rem;
    height: 0.67rem;
    transform: translate(0.1rem, 0.1rem);
  }
}


#searchpage {
  padding-top: 5rem;
}

/* Section components */
.section-title {
  font-size: 1.25rem;
}

.section-link {
  font-size: 1rem;
  font-weight: 400;
}

/* Sidebar */
.sidebar-link {
  display: grid;
  padding: 0.2rem 0;
}

/* Table of contents */
.toc {
  border-left: 2px solid var(--color-theme);
  padding: 0 1rem;
  filter: opacity(0.87);
}

.toc-item {
  font-size: 0.9rem;
}

/* Video container */
.video {
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
  height: 0;
  margin: 1.5rem 0;
  border-radius: 0.6rem;
  background-color: var(--color-bg);
  box-shadow: 0 1rem 2rem var(--color-shadow-light);
}

.video iframe {
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  border: none;
  position: absolute;
  transform: scale(1.02);
}

/* Icons */
.icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 0.5rem;
  fill: currentcolor;
}

/* Links */
.link {
  opacity: 0;
  position: relative;
}

.link-owner:hover .link {
  opacity: 1;
}

.link-yank {
  opacity: 1;
}

.link-yanked {
  position: absolute;
  right: -2.2rem;
  top: -2rem;
  background-color: var(--color-theme);
  color: var(--color-light);
  width: 7rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  border-radius: 1rem;
  text-align: center;
  &::after {
    position: absolute;
    top: 1rem;
    content: "";
    border-color: var(--color-theme) transparent;
    border-style: solid;
    border-width: 1rem 1rem 0 1rem;
    height: 0;
    width: 0;
    transform-origin: 50% 50%;
    transform: rotate(145deg);
    right: 0.45rem;
  }
}

/* Utility Classes */
.wrap {
  max-width: 1240px;
  width: 100%;
  padding: 0 25px;
  margin: 0 auto;
  @media screen and (min-width: 1640px) {
    max-width: 1600px;
  }
}

/* Spacing utilities */
.pt-1 { padding-top: 1.5rem; }
.pt-2 { padding-top: 3rem; }
.pt-3 { padding-top: 4.5rem; }
.pt-4 { padding-top: 6rem; }
.pt-5 { padding-top: 7.5rem; }
.pt-6 { padding-top: 9rem; }
.pt-7 { padding-top: 10.5rem; }
.pt-8 { padding-top: 12rem; }

.pb-1 { padding-bottom: 1.5rem; }
.pb-2 { padding-bottom: 3rem; }
.pb-3 { padding-bottom: 4.5rem; }
.pb-4 { padding-bottom: 6rem; }
.pb-5 { padding-bottom: 7.5rem; }
.pb-6 { padding-bottom: 9rem; }
.pb-7 { padding-bottom: 10.5rem; }
.pb-8 { padding-bottom: 12rem; }

.mt-1 { margin-top: 1.5rem; }
.mt-2 { margin-top: 3rem; }
.mt-3 { margin-top: 4.5rem; }
.mt-4 { margin-top: 6rem; }
.mt-5 { margin-top: 7.5rem; }
.mt-6 { margin-top: 9rem; }
.mt-7 { margin-top: 10.5rem; }
.mt-8 { margin-top: 12rem; }

.mb-1 { margin-bottom: 1.5rem; }
.mb-2 { margin-bottom: 3rem; }
.mb-3 { margin-bottom: 4.5rem; }
.mb-4 { margin-bottom: 6rem; }
.mb-5 { margin-bottom: 7.5rem; }
.mb-6 { margin-bottom: 9rem; }
.mb-7 { margin-bottom: 10.5rem; }
.mb-8 { margin-bottom: 12rem; }

/* Grid system */
[class*='grid-'] {
  grid-gap: 2rem;
}

.grid-2, .grid-3, .grid-4, .grid-auto, .grid-reverse {
  display: grid;
  grid-template-columns: 1fr;
}

@media screen and (min-width: 42rem) {
  .grid-auto { grid-template-columns: 2fr 5fr; }
  .grid-reverse { grid-template-columns: 3fr 1fr; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  .grid-4 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}

/* State classes */
.active {
  color: var(--color-theme);
  .toc {
    height: initial;
  }
}

.is {
  background: var(--color-theme);
  color: var(--color-light);
}

/* Toggle styles */
.toggle svg {
  fill: var(--color-text);
  display: inline-block;
  transform-origin: 50% 50%;
  transform: scale(1.2);
  cursor: pointer;
  margin: 0;
}

/* Scrollable content */
.scrollable {
  width: 100%;
  overflow-x: hidden;
  max-width: calc(100vw - 48px);
}

@media screen and (min-width: 768px) {
  .scrollable {
    max-width: 100%;
  }
}

.scrollable:hover {
  overflow-x: auto;
}

/* Link styles */
.link {
  display: inline-flex;
  align-items: center;
  width: 2.5rem;
  margin: 0 0.25rem 0 0;
  padding: 0 0.25rem;
  opacity: 0;
  transform: translate(-0.33rem, 0.33rem);
  transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
}

.link svg, .link img {
  width: 1.5rem;
  height: 1.5rem;
  fill: var(--color-theme);
}

.link-owner:hover .link {
  opacity: 1;
}

/* Utility classes */
.copy {
  cursor: pointer;
}

.standardize-input {
  appearance: none;
  -webkit-appearance: none;
}

/* Syntax Highlighting and Code Blocks */
@keyframes pulse {
  0% { opacity: 1; }
  75% { opacity: 0.1; }
  100% { opacity: 1; }
}

code {
  font-size: 15px;
  font-weight: 400;
  overflow-y: hidden;
  display: block;
  font-family: 'Monaco', monospace;
  word-break: break-all;
}

code:not([class]) {
  color: var(--color-inline);
  display: inline;
  line-break: anywhere;
}

.windows code-highlighter pre {
  overflow-x: hidden;
}

.windows code-highlighter:hover pre {
  overflow-x: auto;
}

code-highlighter {
  display: grid;
  background: var(--color-accent) !important;
  border-radius: 0.5rem;
  position: relative;
  padding: 0 1rem;
  margin: 1.5rem auto 1rem auto;
  code-highlighter {
    margin: 0;
    padding: 0;
  }
  + code-highlighter {
    margin-top: 2.25rem;
  }
  &:hover > div { opacity: 1; }
  &:hover .lang { opacity: 0.1; }
  .lang {
    position: absolute;
    top: 0;
    right: 0;
    text-align: right;
    width: 7.5rem;
    padding: 0.5rem 1rem;
    font-style: italic;
    text-transform: uppercase;
    font-size: 67%;
    opacity: 0.75;
    color: light-dark(oklch(from #1a5fb4 calc(l * 0.8) calc(c * 0.7) h), var(--color-text));
  }
  pre {
    display: grid;
    width: 100%;
    border-radius: 0 0.2rem 0.2rem 0;
    overflow-x: auto;
    position: relative;
    margin: 0;
    color: var(--color-text) !important;
    border-radius: 4px;
    font-family: 'Monaco', monospace;
      background-color: transparent !important;
      padding-top: 1.5rem;
      padding-bottom: 2rem;
    }

    table {
      display: grid;
      max-width: 100%;
      margin-bottom: 0;
      background: transparent;
    }

    td, th {
      padding: 0;
    }

    .lntd {
      width: 100%;
      border: none;
      &:first-child,
      &:first-child pre {
        width: 2.5rem !important;
        padding-left: 0;
        padding-right: 0;
        color: var(--color-syntax-line-number);
        user-select: none;
      }
      &:first-child pre {
        width: 100%;
        display: flex;
        min-width: 0;
        align-items: center;
        flex-direction: column;
      }

    }

    /* Syntax highlighting classes */
    .err { color: var(--color-syntax-error); }
    .hl { width: 100%; background: var(--color-inline); }

    .ln, .lnt {
      margin-right: 0.75rem;
      padding: 0;
      transition: opacity 0.3s var(--timing-ease);
    }

    .ln, .ln span, .lnt, .lnt span {
      color: var(--color-text);
      opacity: 0.5;
      user-select: none;
    }

    /* Keywords */
    .k, .kc, .kd, .kn, .kp, .kr, .kt, .nt {
      color: var(--color-syntax-keyword);
      font-weight: 500;
    }

    .kn, .kp {
      font-weight: 400;
    }

    /* Names */
    .nb, .no, .nv { color: var(--color-syntax-name); }
    .nc, .nf, .nn { color: var(--color-syntax-name-alt); }

    /* Strings */
    .s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss {
      color: var(--color-syntax-string);
    }

    /* Numbers */
    .m, .mb, .mf, .mh, .mi, .il, .mo {
      color: var(--color-syntax-number);
    }

    /* Operators */
    .ow {
      color: var(--color-syntax-keyword);
      font-weight: 500;
    }

    /* Comments */
    .c, .ch, .cm, .c1 {
      color: var(--color-syntax-comment);
      font-style: italic;
    }

    .cs {
      color: var(--color-syntax-comment-special);
      background-color: light-dark(rgba(220, 53, 69, 0.1), #520000);
      font-weight: 500;
    }

    .cp, .cpf {
      color: var(--color-syntax-comment-special);
      font-weight: 500;
    }

    /* Git diff styles */
    .gd, .gr { color: var(--color-syntax-diff-removed); }
    .ge { font-style: italic; }

    .gh, .gu, .ne {
      color: var(--color-warning);
      font-weight: 500;
    }

    .nd {
      color: light-dark(oklch(from #1a5fb4 calc(l * 0.65) calc(c * 1.1) h), var(--color-warning));
      font-weight: 500;
    }

    .na {
      color: light-dark(oklch(from #1a5fb4 calc(l * 0.65) calc(c * 1.1) h), var(--color-warning));
      font-weight: 500;
    }

    .gi { color: var(--color-syntax-diff-added); }
    .go { color: var(--color-text-muted); }
    .gp { color: var(--color-text-muted); }
    .gs { font-weight: 500; }
    .gt { color: var(--color-syntax-diff-removed); }
    .w { color: light-dark(#6c757d, #666666); }

    /* Highlight.js specific */
    .hljs-string { color: var(--color-syntax-keyword); }
    .hljs-attr { color: light-dark(oklch(from #1a5fb4 calc(l * 0.65) calc(c * 1.1) h), var(--color-syntax-string)); }
    .p .hljs-attr { color: var(--color-light); }
}

/* Pre-wrap utilities */
.pre-wrap {
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
}

.pre-nolines.ln {
  display: none;
}

/* Code panel widget styles */
.panel-box {
  display: inline-flex;
  perspective: 300px;
  grid-gap: 1rem;
  transition: opacity 0.3s var(--timing-ease);
  background: var(--color-accent);
  padding: 0.5rem 1.5rem;
  border-start-start-radius: .5rem;
  border-start-end-radius: .5rem;
  align-items: center;
  position: absolute;
  right: 0rem;
  top: -2.1rem;
  opacity: 1;
  min-width: 0;
}

.panel-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  transform-origin: 50% 50%;
  margin: 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-text);
  border-radius: 0.25rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.panel-icon:hover {
  background: var(--color-accent);
}

.panel-icon.active {
  animation: pulse 0.1s linear;
}

.panel-icon-svg svg {
  fill: var(--color-text);
  width: 1rem;
  height: 1rem;
}

.panel-icon-text {
  font-size: inherit;
}

.panel-hide {
  display: none;
}

.panel-from {
  position: absolute;
  color: var(--color-theme);
  bottom: 0;
  font-size: 1.5rem;
  font-weight: 500;
  padding: 0.5rem 0;
  cursor: pointer;
  letter-spacing: 0.1px;
  z-index: 19;
}

.panel-expanded .panel-from {
  display: none;
}

/* Shell prompt */
.shell {
  position: relative;
}

.shell::before {
  content: "$";
  position: relative;
  margin-right: 0.36rem;
}

.line-flex {
  display: flex;
  min-width: 0;
}

/* Mermaid Diagrams */
.mermaid {
  --theme: light-dark(darkgoldenrod, darkgoldenrod);
  background-color: transparent !important;
  margin-bottom: 2.5rem;
}

.mermaid svg {
  margin: 0 auto;
  display: block;
}

/* Custom Page Styles */
.page-home {
  .main {
    max-width: 640px;
    margin: auto;
    text-align: center;
    h1 {
      font-weight: 300;
      font-size: 4.5rem;
    }
    p {
      font-size: 1.5rem;
      color: var(--color-text-muted);
      &.subheading {
        font-size: 1.75rem;
        font-weight: 700;
      }
    }
    img {
      max-width: 200px;
      margin: auto;
      margin-block: 1rem;
    }
  }
}

#header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-bg);
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem !important;

  .nav {
    display: grid;
    grid-gap: 1rem;
    align-items: center;
    background-color: var(--color-bg);
    @media screen and (min-width: 992px) {
      grid-template-columns: 3rem 1fr;
    }
    @media screen and (min-width: 1171px) {
      grid-template-columns: 3rem 1fr auto auto;
    }
    #logo {
      position: relative;
      picture, img {
        max-width: 10rem;
      }
    }

    .nav-collapsible {
      display: flex;
      align-items: center;
      flex-direction: column;
      background: var(--color-accent);
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      height: 100vh;
      width: 100vw;
      padding: 2rem;
      transition: transform 0.25s var(--timing-ease);
      transform: translateX(-101vw);
      gap: 2rem;

      @media screen and (min-width: 1171px) {
        transform: translateX(0);
        position: relative;
        height: initial;
        width: auto;
        padding: 0;
        justify-content: flex-end;
        background: transparent;
        flex-direction: row;
        gap: 1rem;
        fuse-search {
          margin-inline-end: auto;
        }
      }

      ul {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        @media screen and (min-width: 1171px) {
          flex-direction: row;
        }
      }
    }

    &.show .nav-collapsible {
      transform: translateX(0);
      box-shadow: 0 1rem 4rem var(--color-shadow-nav);
      background: var(--color-bg);
      overflow-y: auto;
    }
  }

  #nav-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    right: 0;
    color: var(--color-text);
    flex-shrink: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    @media screen and (min-width: 1171px) {
      display: none;
    }
    svg { margin: 0; }
    z-index: 1;
  }

  .nav-link {
    display: inline-flex;
    padding-block: 0.5rem;
  }

  .nav-item {
    display: contents;
  }

  .nav-item fuse-search {
    @media screen and (min-width: 992px) {
      margin-right: 1.5rem;
    }
  }

  #repository picture,
  #repository img {
    max-width: 1.25rem;
    margin-block: 0;
  }

}

/* Pager Styles */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin: 2rem 0;
  max-width: 100vw;
  overflow: hidden;
  svg {
    filter: opacity(0.75);
    width: 1.25rem;
    height: 1rem;
    transform-origin: 50% 50%;
  }

}

.pager-lean {
  justify-content: flex-end;
}

.pager-label {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pager-link {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  width: 12.5rem;
  max-width: 40vw;
  position: relative;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  svg {
    height: 1.6rem;
    width: 1.6rem;
    fill: currentColor;
  }
}

.pager-item {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 48%;
  &.prev {
    align-items: flex-start;
  }

  &.next {
    align-items: flex-end;
  }
}

.pager-meta {
  margin: 0.5rem 0;
}

/* CTA Styles */
.cta {
  background-color: var(--color-theme);
  color: var(--color-dark);
  border-radius: 0.25rem;
  display: inline-block;
  padding: 0.75rem 1.25rem;
  text-align: center;
  &:hover {
    opacity: 0.84;
  }

  &.primary {
    color: light-dark(var(--color-light), var(--color-dark));
  }

  &.secondary {
    background-color: var(--color-haze);
    color: light-dark(var(--color-dark), var(--color-dark));
  }
}

.cta-grid {
  display: grid;
  max-width: 15rem;
  grid-gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  @media screen and (min-width: 557px) {
    max-width: 25rem;
  }
}

/* Modern focus management with :focus-visible */
*:focus {
  outline: none; /* Remove default focus outline */
}

*:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: 3px;
}

/* Interactive elements focus states */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  transition: outline-color 0.15s ease;
}

/* Code block panel buttons focus */
.panel-icon:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: 4px;
}

/* Navigation focus */
nav a:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: 2px;
}

/* Shell prompt styling - only show $ on first line */
code-highlighter .language-shell .line:first-of-type .cl::before {
  content: "$ ";
  color: light-dark(oklch(from #1a5fb4 calc(l * 0.7) calc(c * 0.8) h), var(--color-text-muted));
  user-select: none;
}

