/* Shared look for language cards: the blue/white Inter "dive" theme of the
   Pyodide dive, with a per-language --accent set on <body>. */
:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #f7f9fc;
  --surface-strong: #eef3f8;
  --text: #17202a;
  --muted: #647084;
  --border: #dce4ee;
  --accent: #306998;
  --accent-dark: #245579;
  --danger: #a33a2c;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
button, textarea { font: inherit; }

.page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.back { color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--accent); }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.05; margin: 10px 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0; line-height: 1.55; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
}
.chip-logo { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.chip-logo svg { width: 14px; height: 14px; fill: var(--accent); }
/* A runtime that is a proof of concept (Rust) says so beside its chip. */
.chip-experimental {
  display: inline-flex; margin-left: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px dashed var(--accent); color: var(--accent-dark, var(--accent)); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.hero { border-top: 4px solid var(--keyline, var(--accent)); margin-top: 18px; }

.panel {
  margin-top: 22px; padding: 20px 22px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 6px; font-size: 20px; }
.panel > p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }

.runtime-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.runtime-grid dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.runtime-grid dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 10px; accent-color: var(--accent); margin-top: 6px; }
.status { font-weight: 600; }
.status[data-kind="error"] { color: var(--danger); }
.notice { color: var(--muted); font-size: 13px; margin-top: 8px; }

textarea {
  width: 100%; min-height: 220px; padding: 14px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; font-family: var(--mono); font-size: 14px;
  line-height: 1.5; resize: vertical; tab-size: 4;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
button {
  border: 0; border-radius: 9px; padding: 9px 16px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600;
}
button:hover:not(:disabled) { background: var(--accent-dark); }
button.secondary { background: var(--surface-strong); color: var(--text); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

pre {
  margin: 0; padding: 14px; min-height: 64px; max-height: 420px; overflow: auto;
  border-radius: 10px; background: #17202a; color: #e8eef6;
  font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}

.runner-frame { position: absolute; width: 0; height: 0; border: 0; }

@media (max-width: 540px) {
  .panel { padding: 16px; }
}

.dialect { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.dialect select { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
