@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/vendor/fonts/IBMPlexSans-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/vendor/fonts/IBMPlexSans-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/vendor/fonts/IBMPlexSans-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --text: #121214;
  --muted: #5c5c66;
  --border: #d4d4d8;
  --accent: #3f3f46;
  --focus: #18181b;
  --hero-gradient: linear-gradient(180deg, #ececee 0%, #f4f4f5 55%, #f4f4f5 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e;
    --surface: #161618;
    --text: #f2f2f3;
    --muted: #a1a1aa;
    --border: #2a2a2e;
    --accent: #d4d4d8;
    --focus: #e4e4e7;
    --hero-gradient: linear-gradient(180deg, #101012 0%, #0c0c0e 60%, #0c0c0e 100%);
  }
}

[data-theme="dark"] {
  --bg: #0c0c0e;
  --surface: #161618;
  --text: #f2f2f3;
  --muted: #a1a1aa;
  --border: #2a2a2e;
  --accent: #d4d4d8;
  --focus: #e4e4e7;
  --hero-gradient: linear-gradient(180deg, #101012 0%, #0c0c0e 60%, #0c0c0e 100%);
}

[data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --text: #121214;
  --muted: #5c5c66;
  --border: #d4d4d8;
  --accent: #3f3f46;
  --focus: #18181b;
  --hero-gradient: linear-gradient(180deg, #ececee 0%, #f4f4f5 55%, #f4f4f5 100%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body,
  .theme-toggle img,
  .locale-btn-chevron {
    transition: none;
  }
}

a {
  color: var(--text);
}

a:hover {
  color: var(--accent);
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--text);
}

.brand-logo {
  flex-shrink: 0;
  filter: brightness(0) saturate(100%);
}

[data-theme="dark"] .brand-logo,
:root:not([data-theme="light"]) .brand-logo {
  filter: brightness(0) saturate(100%) invert(1);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--text);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-notice {
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.4;
}

.site-notice-inner {
  padding: 0.65rem 0;
  text-align: center;
}

.site-notice-construction {
  background: color-mix(in srgb, #ca8a04 14%, var(--bg));
  color: var(--text);
}

.site-notice-maintenance {
  background: color-mix(in srgb, #dc2626 12%, var(--bg));
  color: var(--text);
}

.site-notice-info {
  background: color-mix(in srgb, #2563eb 12%, var(--bg));
  color: var(--text);
}

.site-notice-warning {
  background: color-mix(in srgb, #ca8a04 14%, var(--bg));
  color: var(--text);
}

.contact-block {
  margin-top: 2rem;
}

.contact-block h2 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

.contact-lxmf code {
  font-size: 0.9rem;
  word-break: break-all;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.icon-btn img {
  width: 1.25rem;
  height: 1.25rem;
  filter: brightness(0) saturate(100%);
}

[data-theme="dark"] .icon-btn img,
:root:not([data-theme="light"]) .icon-btn img {
  filter: brightness(0) saturate(100%) invert(1);
}

.locale-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.locale-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.locale-btn:hover {
  color: var(--text);
}

.locale-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.locale-btn[aria-expanded="true"] .locale-btn-chevron {
  transform: rotate(180deg);
}

.locale-btn img {
  filter: brightness(0) saturate(100%);
}

[data-theme="dark"] .locale-btn img,
:root:not([data-theme="light"]) .locale-btn img {
  filter: brightness(0) saturate(100%) invert(1);
}

.locale-btn-chevron {
  transition: transform 0.15s ease;
}

.locale-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 11rem;
  padding: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  z-index: 30;
}

.locale-panel[hidden] {
  display: none;
}

.locale-option {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 0.35rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--muted);
  text-align: left;
}

.locale-option:hover {
  color: var(--text);
}

.locale-option.is-current {
  color: var(--text);
  font-weight: 600;
}

.locale-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.locale-fallback a {
  color: var(--muted);
  text-decoration: none;
}

.locale-fallback a:hover {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .icon-moon {
    display: block;
  }
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

.site-main {
  flex: 1;
  padding: 2rem 0 4rem;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 40rem;
  padding: 2.5rem 0 1rem;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 18ch;
}

.lead {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--muted);
  max-width: 36rem;
  margin: 0;
  line-height: 1.65;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-decoration: none;
  background: var(--surface);
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.page h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-top: 0;
}

.error-page .error-code {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.error-page .error-lead {
  color: var(--muted);
  max-width: 32rem;
}

.post-list,
.result-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.post-list li,
.result-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li.is-hidden {
  display: none;
}

.blog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.blog-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.blog-feed-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.blog-feed-link:hover {
  color: var(--text);
}

.blog-toolbar {
  margin-bottom: 0.75rem;
}

.blog-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.blog-search-field {
  position: relative;
  display: flex;
  flex: 1 1 18rem;
  align-items: center;
  min-width: 0;
}

.blog-search-icon {
  position: absolute;
  left: 0.85rem;
  width: 1.125rem;
  height: 1.125rem;
  opacity: 0.55;
  pointer-events: none;
  filter: brightness(0) saturate(100%);
}

[data-theme="dark"] .blog-search-icon,
:root:not([data-theme="light"]) .blog-search-icon {
  filter: brightness(0) saturate(100%) invert(1);
}

.blog-search-field input {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.blog-search-field input:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.blog-search-site {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.blog-search-site:hover {
  color: var(--text);
}

.blog-search-status {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.blog-search-status[hidden],
.blog-search-empty[hidden] {
  display: none;
}

.blog-search-empty {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.65rem 0 0;
}

.post-tags li {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

.post-list a,
.result-list a {
  text-decoration: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.post-title {
  font-weight: 600;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-meta-sep {
  margin: 0 0.35rem;
}

.post-body :is(h2, h3) {
  margin-top: 2rem;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.search-form input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
}

.search-form button,
.btn {
  font: inherit;
}

.search-form button {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-tagline {
  margin: 0;
  flex: 1 1 12rem;
  line-height: 1.4;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
}

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

.footer-nav a:hover {
  color: var(--text);
}

.footer-copy {
  margin: 0;
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .footer-copy {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .locale-btn-label {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
