/* dσilystats – styles */

:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --link: #2563eb;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="dark"] {
  --bg: #1c1c1c;
  --fg: #f3f4f6;
  --muted: #b0b0b0;
  --link: #d1d5db;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.85;
}

.wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

header {
  padding: 18px 18px 0;
}

.topbar {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand small {
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
  font-size: 0.92rem;
}

.theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--fg);
}

.theme-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 8px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

main {
  flex: 1;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content {
  width: min(820px, 100%);
  padding: clamp(8px, 2vw, 12px);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.meta code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--muted);
}

h1 {
  font-size: clamp(1.25rem, 1.2rem + 0.7vw, 1.75rem);
  margin: 6px 0 12px;
  line-height: 1.25;
  font-weight: 700;
}

.statement {
  font-size: 1.02rem;
  margin-top: 10px;
}

details {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

summary:hover {
  color: var(--fg);
}

details > div {
  margin-top: 10px;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 18px;
}

footer {
  padding: 0 18px 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer .foot {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
}

/* Footer */
.footer-dark {
  margin-top: 2rem;
  padding: 1.5rem 18px !important;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border, rgba(128,128,128,0.2));
}

.footer-dark .footer-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

#footerLogo {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.footer-dark .footer-powered {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-dark .footer-powered-text {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
}

.footer-dark .footer-links-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-dark .footer-link {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-dark .footer-link:hover {
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-dark .footer-link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-dark .footer-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.footer-dark .footer-icon-github {
  width: 1.1em;
  height: 1.1em;
}

.footer-dark .footer-doi {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-dark .footer-doi-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--muted);
  color: var(--bg);
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0.5;
}

.footer-dark .footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-dark .footer-link-list li {
  margin-bottom: 0.5rem;
}

.footer-dark .footer-link-list .footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-dark .footer-text {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }
}
