/* paper mono, open font license 1.1, see fonts/OFL-PaperMono.txt */
@font-face {
  font-family: "Paper Mono";
  src: url("fonts/PaperMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #f6f1ea;
  --ink: #2a1f3d;
  --muted: rgba(42, 31, 61, 0.7);
  --accent: #a4577f;
  --accent-hover: #7c3f66;
  --box: #fbf8f3;
  --box-edge: #e0d6e6;
  --panel: rgba(246, 241, 234, 0.97);
  --info: rgba(42, 31, 61, 0.45);
  --shadow: rgba(42, 31, 61, 0.08);
}
[data-theme="dark"] {
  --bg: #040306;
  --ink: #e6d9f2;
  --muted: rgba(230, 217, 242, 0.6);
  --accent: #ffecaa;
  --accent-hover: #ffb8d8;
  --box: #15101f;
  --box-edge: #2a2435;
  --panel: rgba(10, 8, 18, 0.96);
  --info: rgba(230, 217, 242, 0.4);
  --shadow: rgba(0, 0, 0, 0.4);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  transition:
    background 0.4s,
    color 0.4s;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
header {
  margin-bottom: 48px;
}
h1 {
  font-family: "Paper Mono", "IBM Plex Mono", monospace;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
header a {
  color: var(--accent);
  text-decoration: none;
}
.sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 14px 0 0;
  text-wrap: balance;
}
.sub a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
header a:hover,
header a:focus-visible {
  text-decoration: underline;
  color: var(--accent-hover);
}

.theme {
  position: fixed;
  top: 20px;
  right: 24px;
  background: transparent;
  border: 1px solid var(--box-edge);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.theme:hover,
.theme:focus-visible {
  color: var(--accent-hover);
  border-color: var(--accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.item {
  position: relative;
  width: 240px;
}
.box {
  display: block;
  width: 240px;
  height: 160px;
  border: 1px solid var(--box-edge);
  border-radius: 4px;
  background: var(--box);
  touch-action: none;
  cursor: crosshair;
  box-shadow: 0 6px 18px var(--shadow);
}
.info {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--info);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.info:hover,
.info:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  height: 160px;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid var(--box-edge);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
  z-index: 3;
}
.item.open .panel {
  display: block;
}
.panel strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.panel p {
  margin: 0 0 10px;
  color: var(--muted);
  text-wrap: balance;
}
.panel a {
  color: var(--accent);
}
.close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--box-edge);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
