@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-700.woff2") format("woff2");
}

:root {
  /* Light theme colors (default) */

  --accent-color: #c04828;
  --accent-hover: #d45530;

  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Terminal window palette (kept dark in both themes so it reads as a terminal) */
  --term-head: #2b2b2d;
  --term-head-fg: #cfcfd6;
  --term-comment: #8a8a93;
  --term-blue: #6cb6ff;
  --st-ready: #7ee2a0;
  --st-beta: #f0c870;
  --st-alpha: #f0a868;
  --st-wip: #8aa0b8;

  --radius: 0.4rem;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);

  --card-bg: #fafafa;
  --card-border: #e5e5e5;
  --muted-fg-color: #595959;
  --terminal-bg-color: #1e1e2e;
  --terminal-fg-color: #cdd6f4;

  --badge-ready-bg: #e6f4ea;
  --badge-ready-fg: #1e7a3c;
  --badge-beta-bg: #fff4e0;
  --badge-beta-fg: #9a6400;
  --badge-alpha-bg: #fdeadb;
  --badge-alpha-fg: #b5500a;
  --badge-wip-bg: #eef1f5;
  --badge-wip-fg: #4a5568;

  --dark-fg-color: #fff;
  --light-fg-color: #141414;
  --light-bg-color: var(--dark-fg-color);
  --dark-bg-color: var(--light-fg-color);
  --fg-color: var(--light-fg-color);
  --bg-color: var(--light-bg-color);
  --link-color: var(--accent-color);
  --light-highlight-bg-color: #ededed;
  --light-highlight-fg-color: #595959;
  --dark-highlight-bg-color: #27272a;
  --dark-highlight-fg-color: #ededed;
  --highlight-fg-color: var(--light-highlight-fg-color);
  --highlight-bg-color: var(--light-highlight-bg-color);
  --link-text-color: var(--accent-color);
  --header-border-color: #ddd;
  --post-bg-color: #e5e5e5;
  --font-face: var(--font-sans);

  --github-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
  --github-icon-black: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='000' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg-color: #d7dce5;
    --bg-color: #0e0f13;
    --link-color: var(--accent-color);
    --light-highlight-bg-color: #161a22;
    --light-highlight-fg-color: #ffffff;
    --dark-highlight-bg-color: #27272a;
    --dark-highlight-fg-color: #ededed;
    --highlight-fg-color: var(--light-highlight-fg-color);
    --highlight-bg-color: var(--light-highlight-bg-color);
    --link-text-color: var(--accent-color);
    --header-border-color: #232a36;
    --post-bg-color: #151922;
    --card-bg: #151922;
    --card-border: #232a36;
    --muted-fg-color: #9aa0ab;

    --badge-ready-bg: #16321f;
    --badge-ready-fg: #7ee2a0;
    --badge-beta-bg: #3a2e12;
    --badge-beta-fg: #f0c870;
    --badge-alpha-bg: #3a2a16;
    --badge-alpha-fg: #f0a868;
    --badge-wip-bg: #2c313a;
    --badge-wip-fg: #b6c0cf;
  }
}

body {
  background-color: var(--bg-color);
  color: var(--fg-color);
}

*,
::after,
::before {
  border: 0 solid #e5e7eb;
  box-sizing: border-box;
}

html {
  font-feature-settings: normal;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
    Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  font-variation-settings: normal;
  line-height: 1.5;
  tab-size: 4;
}

blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
  margin: 0;
}

a {
  color: var(--link-color);
  text-decoration: inherit;
}

a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.playground-toolbar select:focus-visible,
.wasm-run-btn:focus-visible,
#playground-share-btn:focus-visible,
.playground-loader:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* PAGE LAYOUT */
html,
body {
  font-family: var(--font-face);
  height: 100%;
  scroll-behavior: smooth;
}

body {
  line-height: inherit;
  margin: 0;
  display: flex;
  flex-direction: column;
}

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

.page-body {
  flex-grow: 1;
}

/* HEADER */
header {
  display: grid;
  grid-template-columns: repeat(2, max-content) max-content 1fr max-content;
  column-gap: 1em;
  align-items: center;
  justify-items: center;
  padding: 0.5rem 2rem;
  width: 100%;
  border-bottom: 1px solid var(--header-border-color);
  font-size: 1.05rem;
  font-family: var(--font-mono);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--bg-color) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
}

.brand-name {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

.brand-cursor,
.hero-cursor {
  color: var(--accent-color);
  font-weight: 400;
  animation: cursor-blink 1.1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .brand-cursor,
  .hero-cursor {
    animation: none;
  }
}

header .home {
  color: var(--fg-color);
  font-size: 2rem;
  font-weight: bold;
}

header .home:first-child {
  display: flex;
  align-items: center;
  vertical-align: center;
}

header .home svg {
  height: 3rem;
  width: 3rem;
}

header a {
  color: var(--fg-color);
  border-bottom: 2px solid transparent;
}

header a:hover:not(.home) {
  border-bottom: 2px solid var(--link-text-color);
}

.navigation-block {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  color: var(--fg-color);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 0.1em;
  font: inherit;
}

.dropdown:hover .dropdown-toggle,
.dropdown.open .dropdown-toggle {
  border-bottom: 2px solid var(--link-text-color);
}

.dropdown-toggle:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 0.3em;
  padding: 0.4em 0;
  z-index: 100;
  min-width: 10rem;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  padding: 0.4em 1.2em;
  color: var(--fg-color);
  border-bottom: none !important;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--link-text-color);
  background-color: var(--highlight-bg-color);
  border-bottom: none !important;
}

header .icon {
  display: flex;
  align-items: center;
}

#mobile-open-navigation button {
  display: none;
}

#mobile-open-navigation {
  justify-self: right;
}

@media (max-width: 640px) {
  #mobile-open-navigation button {
    display: block;
    flex-direction: column;
    background-color: transparent;
  }

  #mobile-open-navigation button div {
    margin: 0.5em 0;
    width: 2em;
    border-bottom: 0.25em solid var(--fg-color);
  }

  header {
    grid-template-columns: max-content 1fr;
  }

  .spacer {
    display: none;
  }

  .navigation-block {
    margin-top: 0.5em;
    grid-column: auto / span 2;
    justify-self: left;
  }

  header:not(.open) .spacer,
  header:not(.open) .navigation-block {
    display: none;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    display: flex;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1em;
  }

  .dropdown-toggle {
    display: none;
  }
}

/* HERO */
.hero {
  margin: 2.5rem 0 3rem;
  text-align: center;
}

/* Hero wrapped in the terminal window: the body is always dark, so the
   logo, text and spacing are tuned for the dark terminal background. */
.term-hero .term-body {
  padding: 2.5rem 1.5rem 3rem;
}

.term-hero .hero {
  margin: 0;
}

.term-hero .hero-title {
  color: var(--terminal-fg-color);
}

.term-hero .hero-tagline {
  color: var(--term-head-fg);
}

.hero img {
  display: block;
  height: 11em;
  margin: 0 auto 1.2rem;
}

.hero-prompt {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted-fg-color);
  margin-bottom: 0.7rem;
}

.term-hero .hero-prompt {
  color: var(--term-comment);
}

.hero-prompt .pr {
  color: var(--accent-color);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hero-tagline {
  max-width: 40rem;
  margin: 1rem auto 2rem;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted-fg-color);
}

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

@media (min-width: 640px) {
  .hero-title {
    font-size: 4.5rem;
    line-height: 1.02;
  }
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 0.6em 1.4em;
  border-radius: var(--radius);
  border: 1px solid var(--accent-color);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--dark-fg-color);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background-color: transparent;
  color: var(--link-text-color);
}

.btn-ghost:hover {
  background-color: var(--accent-color);
  color: var(--dark-fg-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* MAIN */
main {
  margin: 1rem auto;
  width: 80%;
  flex: 1;
}

@media (min-width: 1024px) {
  main {
    max-width: 56rem;
  }
}

h1,
h2,
h3 {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2rem;
}

p {
  font-size: 1rem;
  line-height: 1.625;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  h1 {
    font-size: 3rem;
    line-height: 1;
  }

  p {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  h2 {
    font-size: 3rem;
    line-height: 1;
  }
}

h2,
h3 {
  margin-top: 3rem;
}

@media (min-width: 640px) {
  li {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

ul {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* FOOTER */
footer {
  align-items: center;
  background-color: var(--bg-color);
  color: var(--fg-color);
  border-top: 1px solid var(--header-border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  flex-grow: 0;
  flex-shrink: 1;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  justify-content: space-between;
  line-height: 1.4;
  padding: 1rem 2rem;
  width: 100%;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--fg-color);
  border-bottom: 2px solid transparent;
}

.footer-links a:hover {
  border-bottom: 2px solid var(--link-text-color);
}

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

.github-icon {
  background-image: var(--github-icon);
  height: 1.25rem;
  width: 1.25rem;
}

.github-icon-black {
  background-image: var(--github-icon-black);
  height: 1em;
  width: 1em;
}

@media (prefers-color-scheme: dark) {
  .github-icon-black {
    background-image: var(--github-icon);
  }
}

/* TERMINAL WINDOW */
.term {
  background: var(--terminal-bg-color);
  border: 1px solid var(--card-border);
  border-radius: 0.6em;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.term-bar {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: var(--term-head);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.term-bar .t {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--term-head-fg);
  pointer-events: none;
}

.win-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.09);
  color: var(--term-head-fg);
  transition: background 0.12s, color 0.12s;
}

.win-btn svg {
  width: 14px;
  height: 14px;
}

.win-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.win-btn.close:hover {
  background: #e01b24;
  color: #fff;
}

.term-body {
  padding: 1.1rem 1.3rem;
  font-family: var(--font-mono);
  color: var(--terminal-fg-color);
  overflow-x: auto;
}

.term-prompt {
  color: var(--term-comment);
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}

.term-prompt .pr {
  color: var(--accent-color);
}

/* PROJECT LIST (command output) */
.projects {
  display: flex;
  flex-direction: column;
}

.prow {
  display: grid;
  grid-template-columns: 9.5rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0.3rem;
  border-bottom: 1px dashed var(--card-border);
  text-decoration: none;
  color: var(--terminal-fg-color);
  transition: background 0.12s;
}

.prow:last-child {
  border-bottom: none;
}

.prow:hover {
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
}

.prow .name {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-color);
}

.prow .name::before {
  content: "\203A  ";
  color: var(--term-comment);
}

.prow .desc {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--term-head-fg);
}

.prow .desc code {
  color: var(--term-blue);
  background: none;
  padding: 0;
  font-size: 0.95em;
}

.st {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.st::before {
  content: "[";
  color: var(--term-comment);
}

.st::after {
  content: "]";
  color: var(--term-comment);
}

.st-ready {
  color: var(--st-ready);
}

.st-beta {
  color: var(--st-beta);
}

.st-alpha {
  color: var(--st-alpha);
}

.st-wip {
  color: var(--st-wip);
}

@media (max-width: 640px) {
  .prow {
    grid-template-columns: 1fr auto;
  }

  .prow .desc {
    grid-column: 1 / -1;
  }
}

/* STATUS BADGES (project detail page titles) */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: 0.3em;
  vertical-align: middle;
  margin-left: 0.6em;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.badge-ready {
  background: var(--badge-ready-bg);
  color: var(--badge-ready-fg);
}

.badge-beta {
  background: var(--badge-beta-bg);
  color: var(--badge-beta-fg);
}

.badge-alpha {
  background: var(--badge-alpha-bg);
  color: var(--badge-alpha-fg);
}

.badge-wip {
  background: var(--badge-wip-bg);
  color: var(--badge-wip-fg);
}

.title {
  font-size: 3em;
  font-weight: 700;
  margin-bottom: 0.5em;
  text-transform: capitalize;
}

@media (min-width: 640px) {
  .title {
    font-size: 4rem;
    line-height: 1;
  }
}

/* Terminal prompt line under a project-page title, echoing the hero motif. */
.page-prompt {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted-fg-color);
  margin: -0.25em 0 1.4em;
}

.page-prompt .pr {
  color: var(--accent-color);
}

/* GSOC PROJECT IDEAS (card grid) */
.gsoc-ideas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.gsoc-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.gsoc-card:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gsoc-card-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 0 0 0.6rem;
  line-height: 1.3;
}

.gsoc-card-title::before {
  content: "\203A  ";
  color: var(--muted-fg-color);
}

.gsoc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}

.gsoc-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18em 0.6em;
  border-radius: 0.3em;
  white-space: nowrap;
  background: var(--badge-wip-bg);
  color: var(--badge-wip-fg);
}

.gsoc-badge.diff-easy {
  background: var(--badge-ready-bg);
  color: var(--badge-ready-fg);
}

.gsoc-badge.diff-medium {
  background: var(--badge-beta-bg);
  color: var(--badge-beta-fg);
}

.gsoc-badge.diff-hard {
  background: #fde8e8;
  color: #b42318;
}

@media (prefers-color-scheme: dark) {
  .gsoc-badge.diff-hard {
    background: #3a1c1c;
    color: #f3a39a;
  }
}

.gsoc-card p {
  margin: 0 0 0.6rem;
}

.gsoc-card ul {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
}

.gsoc-card li {
  margin: 0.15rem 0;
}

.gsoc-skills {
  font-size: 0.85rem;
  color: var(--muted-fg-color);
  margin: 0;
}

.details {
  margin-bottom: 1.5em;
  color: var(--fg-color);
}

.post-thingy {
  display: block;
  padding: 1em;
  color: var(--fg-color);
  background: var(--post-bg-color);
  border-radius: 0.3em;
  border: 0.2em solid var(--post-bg-color);
  margin-bottom: 0.5em;
}

.post-thingy:hover {
  border-color: var(--link-text-color);
  background: transparent;
}

.post-thingy h1 {
  margin-bottom: 0.2em;
}

blockquote {
  border-left: 0.2em solid gray;
  padding-left: 1em;
}

main img {
  max-width: 100%;
  height: auto;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 0.8em;
  margin-bottom: 2em;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.links > a {
  padding: 0.45em 1em;
  color: var(--link-text-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius);
  flex: 1;
  text-align: center;
  transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.links > a:hover {
  color: var(--dark-fg-color);
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* WASM PLAYGROUND */
.playground-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 1em 0 0;
  font-size: 0.9em;
}

.playground-toolbar select {
  padding: 0.3em 0.5em;
  border-radius: 0.3em;
  border: 1px solid var(--header-border-color);
  background: var(--highlight-bg-color);
  color: var(--highlight-fg-color);
  font-size: 1em;
  cursor: pointer;
}

.playground-loaders {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0.6em 0 0;
  font-size: 0.9em;
}

.playground-loaders-label {
  opacity: 0.8;
}

.playground-loader {
  padding: 0.3em 0.7em;
  background: var(--highlight-bg-color);
  color: var(--highlight-fg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 0.3em;
  font-family: "Fira Code", monospace;
  font-size: 0.85em;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}

.playground-loader:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
}

.playground-loader:disabled {
  cursor: default;
}

.playground-loader.loaded {
  border-color: #2ea043;
  background: #2ea043;
  color: white;
  opacity: 0.9;
}

.playground-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6em;
  margin: -0.5em 0 1.2em;
  font-size: 0.9em;
}

#playground-share-btn {
  padding: 0.3em 0.7em;
  background: var(--highlight-bg-color);
  color: var(--highlight-fg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 0.3em;
  font-family: "Fira Code", monospace;
  font-size: 0.85em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}

#playground-share-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
}

#playground-share-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

#playground-share-btn.copied {
  border-color: #2ea043;
  background: #2ea043;
  color: white;
}

.playground-share-hint {
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#wasm-playground {
  width: 100%;
  min-height: 480px;
  border-radius: 0.5em;
  overflow: hidden;
  margin: 1.5em 0;
  border: 1px solid var(--header-border-color);
}

/* Playground wrapped in the terminal-window chrome: the term frame supplies
   the border, rounding and shadow, so the inner element drops its own. */
.term-playground {
  margin: 1.5em 0;
}

.term-playground #wasm-playground {
  margin: 0;
  border: none;
  border-radius: 0;
}

.playground-version {
  margin: -0.5em 0 1.5em;
  font-size: 0.85em;
  color: var(--muted-fg-color, inherit);
  opacity: 0.8;
}

.playground-version:empty {
  display: none;
}

#wasm-playground .wasm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
  background: var(--terminal-bg-color);
  color: var(--terminal-fg-color);
  font-family: monospace;
  font-size: 1.1em;
}

/* INLINE WASM EXAMPLES */
.wasm-example {
  margin: 1em 0;
}

.wasm-example-code {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.wasm-example-code pre {
  flex: 1;
  padding: 0.8em 1em;
  background: var(--highlight-bg-color);
  color: var(--highlight-fg-color);
  border-radius: 0.3em 0 0 0.3em;
  font-family: "Fira Code", monospace;
  font-size: 0.9em;
  overflow-x: auto;
  margin: 0;
}

.wasm-run-btn {
  padding: 0.8em 1.5em;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0 0.3em 0.3em 0;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.wasm-run-btn:hover {
  background: var(--accent-hover);
}

.wasm-run-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.wasm-example-output {
  margin-top: 0;
}

.wasm-example-output pre {
  padding: 0.8em 1em;
  background: var(--terminal-bg-color);
  color: var(--terminal-fg-color);
  border-radius: 0 0 0.3em 0.3em;
  font-family: "Fira Code", monospace;
  font-size: 0.9em;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
}

/* PLAYGROUND CLICKABLE EXAMPLES */
.playground-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 1em 0 2em;
}

.playground-example {
  padding: 0.4em 0.8em;
  background: var(--highlight-bg-color);
  color: var(--highlight-fg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 0.3em;
  font-family: "Fira Code", monospace;
  font-size: 0.85em;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.playground-example:hover {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
}

/* COPY-TO-CLIPBOARD ON CODE BLOCKS */
.code-block-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-family: var(--font-face);
  font-weight: 600;
  color: var(--highlight-fg-color);
  background: var(--highlight-bg-color);
  border: 1px solid var(--header-border-color);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.code-block-wrapper:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--dark-fg-color);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.copy-btn.copied {
  opacity: 1;
  color: var(--badge-ready-fg);
  background: var(--badge-ready-bg);
  border-color: var(--badge-ready-fg);
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  *,
  ::before,
  ::after {
    transition: none !important;
    animation: none !important;
  }
}

/* HOMEPAGE CONTENT (scoped) */
.home-content h1 {
  font-size: 1.7rem;
  margin-top: 3.5rem;
  margin-bottom: 1.2rem;
}

.home-content h1::before {
  content: "> ";
  color: var(--accent-color);
}

@media (min-width: 640px) {
  .home-content h1 {
    font-size: 2.1rem;
  }
}

.home-content ul {
  list-style: none;
  padding-left: 0;
}

.home-content li {
  position: relative;
  padding-left: 1.5rem;
}

.home-content li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--st-ready);
  font-family: var(--font-mono);
  font-weight: 700;
}
