:root,
[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-elev: #1a1a1a;
  --bg-card: #242424;
  --line: #333333;
  --line-strong: #4a4a4a;
  --text: #e8e8e8;
  --text-dim: #9a9a9a;
  --accent: #3ddc84;
  --accent-ink: #0d0d0d;
  --accent-soft: rgba(61, 220, 132, 0.12);
  --hero-bg-image: url("/assets/media/hero-dark.jpeg");
  --hero-overlay: linear-gradient(
    180deg,
    rgba(13, 13, 13, 0.55) 0%,
    rgba(13, 13, 13, 0.72) 55%,
    rgba(13, 13, 13, 0.88) 100%
  );
  --header-h: 4rem;
  --max: 68rem;
  /* System fonts only — no third-party webfont CDN (GNU/privacy-friendly) */
  --font-display: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --radius: 0.35rem;
}

[data-theme="light"] {
  --bg: #f2f2f2;
  --bg-elev: #ffffff;
  --bg-card: #ececec;
  --line: #d0d0d0;
  --line-strong: #a8a8a8;
  --text: #1a1a1a;
  --text-dim: #5a5a5a;
  --accent: #1a9e56;
  --accent-ink: #ffffff;
  --accent-soft: rgba(26, 158, 86, 0.12);
  --hero-bg-image: url("/assets/media/hero-light.jpeg");
  --hero-overlay: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(242, 242, 242, 0.72) 55%,
    rgba(242, 242, 242, 0.9) 100%
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 220, 132, 0.08), transparent 55%),
    var(--bg);
}

html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(26, 158, 86, 0.08), transparent 55%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(10px);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: var(--bg-elev);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.05rem;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

html[data-theme="dark"] .theme-icon-light,
html:not([data-theme="light"]) .theme-icon-light {
  display: none;
}

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

html[data-theme="light"] .theme-icon-light {
  display: inline;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.1rem;
}

.lang-menu {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 8.5rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: 50;
}

.lang-option {
  display: block;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: calc(var(--radius) - 0.1rem);
}

.lang-option:hover,
.lang-option.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.site-main {
  min-height: calc(100vh - var(--header-h) - 8rem);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--text-dim);
  margin: 0 0 2rem;
  max-width: 40rem;
}

.section-lead-story {
  max-width: 42rem;
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero {
  padding: 4.5rem 1.25rem 3.5rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
  background-image: var(--hero-overlay), var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-acronym {
  margin: 0.85rem auto 1.75rem;
  max-width: 40rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0.04em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Hero CTAs: grayscale by default, accent green on hover (acronym stays green) */
.hero-cta .btn-accent {
  background: #3a3a3a;
  color: #e8e8e8;
  border-color: #4a4a4a;
}

.hero-cta .btn-ghost {
  background: transparent;
  color: #c0c0c0;
  border-color: #5a5a5a;
}

.hero-cta .btn-accent:hover,
.hero-cta .btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  filter: none;
}

html[data-theme="light"] .hero-cta .btn-accent {
  background: #d8d8d8;
  color: #1a1a1a;
  border-color: #b0b0b0;
}

html[data-theme="light"] .hero-cta .btn-ghost {
  color: #4a4a4a;
  border-color: #9a9a9a;
}

html[data-theme="light"] .hero-cta .btn-accent:hover,
html[data-theme="light"] .hero-cta .btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-accent:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.feature-card-emphasis {
  border-color: var(--accent);
}

.feature-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.feature-sub {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.feature-card p:last-child {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

.examples {
  background: var(--bg-elev);
  border-block: 1px solid var(--line);
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.step-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.step-num {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  margin: 0 0 0.5rem;
}

.step-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.square-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 11rem;
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.square-card:hover {
  border-color: var(--accent);
  background: #2a2a2a;
  text-decoration: none;
  transform: translateY(-2px);
}

.square-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.square-card p {
  margin: 0;
  color: var(--text-dim);
  flex: 1;
}

.square-card-go {
  margin-top: 1rem;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
}

.page-article {
  padding: 2.75rem 1.25rem 4rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.page-summary {
  margin: 0;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.crumb {
  margin: 0 0 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.crumb a {
  color: var(--text-dim);
}

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

.prose h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose table {
  width: 100%;
  margin: 1.35rem 0 1.75rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.prose thead th {
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.prose th,
.prose td {
  padding: 0.85rem 1.1rem;
  vertical-align: top;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.prose th:last-child,
.prose td:last-child {
  border-right: 0;
}

.prose tbody tr:last-child th,
.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
}

.prose strong {
  color: var(--text);
}

.prose .prose-accent {
  color: var(--accent);
  font-weight: inherit;
}

.prose h3 .prose-title-accent {
  color: var(--accent);
}

.doc-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.doc-package-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.doc-package-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.doc-package-id {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.doc-package-card > p:not(.doc-package-id):not(.doc-package-links) {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  flex: 1;
}

.doc-package-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.doc-package-links .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.doc-package-distro {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.callout-soon {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
}

.callout-soon code {
  border-color: transparent;
}

.distro-tabs {
  margin: 1.25rem 0 1.75rem;
}

.distro-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.distro-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.distro-tab:hover {
  color: var(--text);
  background: var(--bg-card);
}

.distro-tab[aria-selected="true"],
.distro-tab.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.distro-panel {
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.15rem;
}

.distro-panel.is-active {
  display: block;
}

.distro-panel > p:first-child {
  margin-top: 0;
}

.distro-panel pre {
  margin: 0.75rem 0;
}

.distro-panel ul {
  margin-bottom: 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-card);
  padding: 0.1em 0.35em;
  border-radius: 0.2rem;
  border: 1px solid var(--line);
}

.prose pre {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.prose pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

.prose .media,
.tutorial-body figure {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.prose figcaption {
  padding: 0.6rem 0.85rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 2rem 0;
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand p {
  margin: 0.35rem 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}

.footer-nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
}

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

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: 32rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* display:flex above must not override the HTML hidden attribute */
.cookie-banner[hidden] {
  display: none !important;
}

.cookie-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  flex: 1 1 12rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.cookie-actions .btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 35;
}

@media (max-width: 900px) {
  .feature-grid,
  .step-list,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    z-index: 45;
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .header-actions {
    order: 2;
  }
}
