:root {
  --layout-max: 1100px;
  --sidebar-width: 280px;
  --pico-primary: #006677;
  --pico-primary-background: #006677;
  --pico-primary-underline: rgba(0, 102, 119, 0.35);
  --pico-primary-hover: #005463;
  --pico-primary-focus: rgba(0, 102, 119, 0.25);
  --pico-primary-inverse: #ffffff;
}

html[data-theme='light'] {
  --page-bg-start: #f6f3ee;
  --page-bg-mid: #ffffff;
  --page-bg-end: #f9f7f4;
  --footer-bg: #062b33;
  --footer-fg: #e9f2f2;
  --footer-muted: #b7c9cb;
  --footer-icon-bg: rgba(255, 255, 255, 0.14);
  color-scheme: light;
}

html[data-theme='dark'] {
  --page-bg-start: #0c1416;
  --page-bg-mid: #0f1d1f;
  --page-bg-end: #0b1113;
  --footer-bg: #062b33;
  --footer-fg: #e9f2f2;
  --footer-muted: #b7c9cb;
  --footer-icon-bg: rgba(255, 255, 255, 0.14);
  color-scheme: dark;
}

body {
  background: linear-gradient(180deg, var(--page-bg-start) 0%, var(--page-bg-mid) 55%, var(--page-bg-end) 100%);
}


.site-footer {
  padding: 0.6rem 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--footer-bg);
  color: var(--footer-fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1rem;
}

.site-header a {
  color: var(--footer-fg);
}

.site-header a:hover {
  color: var(--footer-fg);
}

.nav-brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  position: relative;
}

.nav-brand img {
  border-radius: 10px;
  border:none;
  position: fixed;
  text-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.lang-link {
  white-space: nowrap;
}

.site-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.site-sidebar {
  display: none;
}

.site-content {
  min-width: 0;
  grid-column: 1;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #8882;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
}

.sidebar-toggle__icon {
  font-size: 1.2rem;
  line-height: 1;
}

html[data-theme='dark'] .sidebar-toggle {
  background: rgba(8, 18, 20, 0.8);
  border-color: rgba(255, 255, 255, 0.18);
}

@media (min-width: 960px) {
  .sidebar-toggle {
    display: none;
  }
}

.sidebar-nav details {
  margin-bottom: 1rem;
}

.sidebar-nav summary {
  font-weight: 600;
  cursor: pointer;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

.sidebar-subsections {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

html[data-theme='dark'] .sidebar-subsections {
  border-left-color: rgba(255, 255, 255, 0.16);
}

.toc {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(38, 26, 14, 0.08);
}

.toc h4 {
  margin-bottom: 0.75rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

aside li,
.toc-item {
  margin-bottom: 0;
  line-height: 1.2rem;
}

.toc-item--sub {
  margin-left: 1rem;
  font-size: 0.92rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 2rem 0;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.pager-link:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.3);
}

.pager-link--next {
  margin-left: auto;
  background: var(--pico-primary);
  border-color: transparent;
  color: var(--pico-primary-inverse);
}

.pager-link--next:hover {
  background: var(--pico-primary-hover);
}

html[data-theme='dark'] .pager-link {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(12, 22, 24, 0.9);
}

html[data-theme='dark'] .pager-link--next {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}



@media (min-width: 960px) {
  .site-main {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  }

  .site-sidebar {
    display: block;
    grid-column: 2;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-top: 90px;
  }
}

@media (max-width: 959px) {
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 25;
  }

  .sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .site-sidebar {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: min(80vw, 320px);
    height: 100vh;
    background: var(--page-bg-mid);
    padding: 5rem 1.25rem 2rem;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: -20px 0 40px rgba(0, 0, 0, 0.2);
    z-index: 30;
    overflow-y: auto;
  }

  .site-sidebar.is-open {
    transform: translateX(0);
  }
}

.hero {
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 3vw, 3.6rem);
}

.content-abstract {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: .9rem;
  font-weight: 600;
  font-style: italic;
}

html[data-theme='dark'] .content-abstract {
  background: rgba(16, 30, 32, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin-top: 2rem;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(38, 26, 14, 0.08);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.9rem;
  display: block;
}

html[data-theme='dark'] .card {
  background: rgba(20, 34, 36, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .toc {
  background: rgba(16, 30, 32, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

footer {
  background-color: var(--footer-bg);
  color: var(--footer-fg);
  padding: 10px;
  text-align: center;
  font-size: small;
  bottom: 0;
  width: 100%;
  margin: 1em 0 0 0;
  font-family: Arial, Helvetica, sans-serif;
  clear: both;
}

#footer2,
#footer1 {
  display: flex;
  flex-wrap: wrap;
  margin: auto;
  position: relative;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
}

#footer1 {
  flex-direction: row;
}

#footer2 {
  flex-direction: row-reverse;
  margin-top: 2em;
}

#archive-note {
  font-size: small;
  font-weight: 600;
  text-align: center;
  color: var(--footer-muted);
}

#archive-note img {
  display: block;
  margin: auto;
}

#footer1 p {
  max-width: 300px;
}

#footer1 > *,
#footer2 > div {
  margin: auto;
}

#footer1 > iframe {
  border: 0;
  width: 300px;
  height: 250px;
  background-color: var(--footer-bg);
}

#footer2 a {
  color: var(--footer-muted);
}

#social-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

#social-buttons a {
  text-decoration: none;
  border: 0;
  width: 50px;
  height: 50px;
  padding: 2px;
  margin: 5px;
  color: var(--footer-fg);
  border-radius: 50%;
  background-color: var(--footer-icon-bg);
}

footer .hero {
  height: auto;
  color: var(--footer-fg);
}

@media screen and (max-width: 600px) {
  footer .hero .cta {
    font-size: 5mm;
    margin: 1em auto;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--footer-fg);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.theme-icon {
  display: inline-flex;
  line-height: 1;
  font-size: 0.95rem;
}

html[data-theme='light'] .theme-icon--moon {
  opacity: 0.35;
}

html[data-theme='dark'] .theme-icon--sun {
  opacity: 0.35;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.graphviz,
.mermaid {
  overflow-x: auto;
}

.float-right {
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
}
