/* Jcode site — coming-soon aesthetic: mono, monochrome, minimal. */

/* Self-hosted so every visitor sees the identical font. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}

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

:root {
  --ink: #111;
  --muted: #666;
  --faint: #999;
  --rule: #ccc;
  --wash: #f4f4f4;
  --bg: #fff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* ---- Hero ---- */

main > section:first-of-type {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

main > section:first-of-type h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

#donut-canvas {
  margin: 0.5rem 0 1rem;
}

main > section:first-of-type > p:first-of-type {
  color: var(--muted);
  margin: 0;
}

main > section:first-of-type p {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
}

/* ---- Install command (copyable) ---- */

.install-command {
  display: inline-flex;
  align-items: stretch;
  margin-top: 1.75rem;
  border: 1px solid var(--rule);
  background: var(--wash);
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.install-command pre {
  margin: 0;
  padding: 0.75rem 1.25rem;
  overflow-x: auto;
}

.install-command code {
  font-size: 0.9rem;
  white-space: nowrap;
}

.copy-button {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
  border: none;
  border-left: 1px solid var(--rule);
  padding: 0 1rem;
  cursor: pointer;
  min-width: 5.5em;
}

.copy-button:hover {
  color: var(--ink);
}

/* Sticky install pill after scrolling past the hero */
.install-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 1rem;
  display: flex;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  transform: translateY(-150%);
  transition: transform 0.25s ease;
  z-index: 10;
}

.install-bar.visible {
  transform: translateY(0);
}

.install-bar .install-command {
  margin-top: 0;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.install-bar pre {
  padding: 0.5rem 1rem;
}

/* ---- Download buttons ---- */

.downloads {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-decoration: none;
}

.download-button:hover {
  border-color: var(--ink);
}

.download-button img {
  display: block;
}

.download-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.beta-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

/* Windows WIP tooltip, anchored above the button with a down-pointing arrow */
.win-wrap {
  position: relative;
  display: inline-flex;
}

.win-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0.85rem;
  z-index: 5;
}

.win-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--rule);
}

.win-tooltip::before {
  content: "";
  position: absolute;
  top: calc(100% - 1.5px);
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--bg);
  z-index: 1;
}

#star-count {
  color: var(--muted);
}

/* ---- Rules ---- */

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 4rem;
}

/* ---- Feature articles ---- */

article {
  margin: 0 0 5.5rem;
}

article:last-child {
  margin-bottom: 0;
}

/* Eyebrow label above each heading */
article > p:first-child {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2.5rem 0 0.5rem;
}

article p {
  margin: 0 0 1rem;
  color: var(--ink);
}

article code {
  background: var(--wash);
  border: 1px solid var(--rule);
  padding: 0 0.3em;
  font-size: 0.9em;
}

/* ---- Links ---- */

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

a:hover {
  border-bottom-color: var(--ink);
}

/* ---- Tables ---- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0 1.5rem;
  display: block;
  overflow-x: auto;
}

thead th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  padding: 0 1rem 0.5rem 0;
  border-bottom: 1px solid var(--ink);
}

tbody td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:first-child td {
  font-weight: 700;
}

tbody td:last-child {
  color: var(--muted);
}

/* Bar graphs */
progress {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 10px;
  border: none;
  background: var(--wash);
  display: block;
  border-radius: 5px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: var(--wash);
  border-radius: 5px;
}

progress::-webkit-progress-value {
  background: var(--ink);
  border-radius: 5px;
}

progress::-moz-progress-bar {
  background: var(--ink);
  border-radius: 5px;
}

/* ---- Figures / media ---- */

figure {
  margin: 1.5rem 0 0;
}

figure img,
figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

figcaption {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* ---- Footer ---- */

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-brand {
  color: var(--muted);
}

/* ---- Small screens ---- */

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  main > section:first-of-type h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  progress {
    width: 110px;
  }
}
