/* SPDX-License-Identifier: CC-BY-4.0 */
/* Postmodem website. Brand colours come from brand/palette.css (docs/brand/palette.css). */
@import url("brand/palette.css");

:root {
  color-scheme: light dark;

  /* Semantic tokens, light theme */
  --bg: var(--pm-paper);
  --bg-sunk: #f2f5f7;
  --surface: var(--pm-paper);
  --text: var(--pm-ink);
  --text-muted: var(--pm-slate);
  --border: var(--pm-edge);
  --accent: var(--pm-blue);
  --accent-text: var(--pm-paper);
  --link: var(--pm-blue);
  --highlight: var(--pm-orange);
  --row-head: var(--pm-blue);
  --row-head-text: var(--pm-paper);
  --row-alt: #eef3f6;
  --code-bg: var(--pm-night);
  --code-text: var(--pm-ink-light);

  --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--pm-night);
    --bg-sunk: #161c21;
    --surface: #222b32;
    --text: var(--pm-ink-light);
    --text-muted: var(--pm-slate-light);
    --border: var(--pm-edge-dark);
    --accent: var(--pm-blue-light);
    --accent-text: var(--pm-night);
    --link: var(--pm-blue-light);
    --row-head: var(--pm-edge-dark);
    --row-head-text: var(--pm-ink-light);
    --row-alt: #263038;
    --code-bg: #12171b;
  }
}

:root[data-theme="dark"] {
  --bg: var(--pm-night);
  --bg-sunk: #161c21;
  --surface: #222b32;
  --text: var(--pm-ink-light);
  --text-muted: var(--pm-slate-light);
  --border: var(--pm-edge-dark);
  --accent: var(--pm-blue-light);
  --accent-text: var(--pm-night);
  --link: var(--pm-blue-light);
  --row-head: var(--pm-edge-dark);
  --row-head-text: var(--pm-ink-light);
  --row-alt: #263038;
  --code-bg: #12171b;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px / 1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--highlight);
}

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 2px;
}

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

.wrap {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

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

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 6px;
}

/* Top bar */
.topbar {
  border-top: 6px solid var(--pm-blue);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.brand img {
  width: 32px;
  height: 32px;
}

.topbar nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  font-size: 15px;
}

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

.topbar nav a:hover {
  color: var(--link);
}

/* Hero */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.hero picture img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
}

.lede {
  max-width: 44rem;
  margin: 28px auto 0;
  font-size: 1.15rem;
  color: var(--text-muted);
}

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

.cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--accent);
}

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

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

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

.badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

.badges img {
  height: 28px;
  width: auto;
}

/* Status note */
.notice {
  border-left: 6px solid var(--highlight);
  background: var(--bg-sunk);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 8px 0 0;
}

.notice p {
  margin: 0;
}

/* Sections */
section {
  padding: 40px 0;
}

h2 {
  font-family: var(--mono);
  font-size: 1.5rem;
  margin: 0 0 20px;
  letter-spacing: 0.01em;
}

h2::after {
  content: "_";
  color: var(--highlight);
  margin-left: 2px;
}

/* The feature list as a classic forum index */
.forum {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.forum caption {
  text-align: left;
  color: var(--text-muted);
  font-size: 15px;
  padding-bottom: 8px;
}

.forum th {
  background: var(--row-head);
  color: var(--row-head-text);
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
}

.forum td {
  padding: 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.forum tbody tr:nth-child(even) td {
  background: var(--row-alt);
}

.forum .icon {
  width: 52px;
  text-align: center;
  font-size: 22px;
}

.forum .name {
  font-weight: 700;
  color: var(--link);
}

.forum .desc {
  display: block;
  color: var(--text-muted);
  font-size: 15px;
}

.forum .meta {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .forum .meta,
  .forum th.meta {
    display: none;
  }
}

/* Run it */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.card p {
  margin: 0 0 12px;
  color: var(--text-muted);
}

pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font: 14px / 1.55 var(--mono);
}

pre .prompt {
  color: var(--pm-orange);
  user-select: none;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Palette */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.swatch {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.swatch .chip {
  height: 72px;
  background: var(--c);
  border-bottom: 1px solid var(--border);
}

.swatch div + div {
  padding: 8px 12px;
  font-size: 14px;
}

.swatch code {
  display: block;
  color: var(--text-muted);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunk);
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 24px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

footer p {
  margin: 0;
}
