/* The library's style sheet (ADR-086: deep space, one dark look). Fonts: Geist and Geist Mono,
   SIL OFL 1.1 (fonts/OFL.txt), from vercel/geist-font release v1.7.2 (variable woff2, weights 100-900):
   Geist.woff2      sha256 a369fcf5628ea2aa4e1b9e2ec6a5b3624e365bda588e1f0f2f12b564f728fbb8
   GeistMono.woff2  sha256 fba8f577f38a2bbcbe818efa6348dd58f36303a10b8737c42fefad275be563ab
   No inline style anywhere (CSP style-src 'self'): the script sets positions and sizes through
   element.style, the colours come from the classes below. */

@font-face {
  font-family: Geist;
  src: url('/assets/fonts/Geist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/fonts/GeistMono.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@property --glow {
  syntax: '<color>';
  inherits: true;
  initial-value: #5b4bff;
}

:root {
  --space: #04050b;
  --glass: rgba(160, 175, 255, 0.06);
  --glass-2: rgba(160, 175, 255, 0.11);
  --panel: rgba(18, 22, 42, 0.72);
  --line: rgba(170, 185, 255, 0.14);
  --line-2: rgba(170, 185, 255, 0.26);
  --text: #eef1ff;
  --text-2: #c3c9e6;
  --muted: #8b93b4;
  --faint: #6a7392;
  --ring: #c3c9e6; /* the focus ring */
  --live: #34d399;
  --red: #ff5a6a;
  --red-pale: rgba(255, 90, 106, 0.1);
  --ext1: #b46cff;
  --advn: #4ade80;
  --yr10: #5aa9ff;
  --ext2: #ff5c7a;
  --std2: #a3a9bd;
  --school: #f5b955;
  --other: #a3a9bd;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --spring: cubic-bezier(0.34, 1.42, 0.5, 1);
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --glow: #5b4bff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--space);
  color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body[data-page='start'] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  flex: none;
}

.mono,
pre,
code {
  font-family: var(--mono);
}

/* ---------- space ---------- */

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  transition: --glow 1.2s var(--ease);
  background:
    radial-gradient(40% 35% at 30% 45%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    radial-gradient(35% 30% at 75% 70%, color-mix(in srgb, var(--glow) 12%, transparent), transparent 70%),
    radial-gradient(60% 50% at 60% 10%, rgba(70, 90, 200, 0.1), transparent 70%);
}

body.glow-EXT1 { --glow: var(--ext1); }
body.glow-ADVN { --glow: var(--advn); }
body.glow-YR10 { --glow: var(--yr10); }
body.glow-EXT2 { --glow: var(--ext2); }
body.glow-STD2 { --glow: var(--std2); }
body.glow-SCHOOL { --glow: var(--school); }
body.glow-other { --glow: var(--other); }

/* ---------- header, account, publish button ---------- */

header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  flex: none;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(to bottom, rgba(4, 5, 11, 0.85), rgba(4, 5, 11, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--glow) 60%);
  box-shadow: 0 0 12px var(--glow);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account {
  position: relative;
}

.account summary {
  list-style: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--glass-2);
  border: 1px solid var(--line);
}

.account summary::-webkit-details-marker {
  display: none;
}

.account .menu {
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 180px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(14, 17, 34, 0.95);
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.8);
  z-index: 20;
}

.account .menu p {
  margin: 4px 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.account .menu form {
  margin: 0;
}

.account .menu button {
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 8px;
}

.account .menu button:hover {
  background: var(--glass-2);
}

.fab {
  position: fixed;
  z-index: 8;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s var(--spring), border-color 0.2s, box-shadow 0.3s;
}

.fab:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 210, 255, 0.4);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.8), 0 0 24px -8px var(--glow);
}

.fab.busy {
  border-color: color-mix(in srgb, var(--live) 45%, var(--line-2));
}

/* ---------- marks ---------- */

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  flex: none;
  display: inline-block;
}

.dot.failed {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  flex: none;
  display: inline-block;
}

.spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  border-top-color: var(--text-2);
  animation: spin 0.8s linear infinite;
  flex: none;
  display: inline-block;
}

.spinner.sm {
  width: 8px;
  height: 8px;
  border-width: 1.2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- the booklet browser ---------- */

.space {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
}

#stage {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#world {
  position: relative;
  width: 100%;
}

#links {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}

.crumbs {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  font-size: 12px;
  color: var(--faint);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.crumbs button {
  pointer-events: auto;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
}

.crumbs button:hover {
  color: var(--text);
  background: var(--glass);
}

.crumbs .cur {
  color: var(--text-2);
  padding: 4px 8px;
}

.space #stage {
  top: 40px;
}

.ask {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s, transform 0.6s var(--ease);
  z-index: 2;
  padding-left: 16px;
  padding-right: 16px;
}

.ask p {
  margin: 6px 0 0;
  color: var(--muted);
}

.ask .ask-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--text);
}

.ask.gone {
  opacity: 0;
  transform: translateY(-16px);
}

.ask .lib-note {
  color: var(--red);
}

.space noscript {
  position: absolute;
  top: 120px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
}

/* the links between the bubbles */
.lk {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.7s var(--ease) forwards;
}

.lk.brace {
  stroke: color-mix(in srgb, var(--glow) 65%, white 10%);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 60%, transparent));
}

.lk.tick {
  stroke-width: 1;
}

.lk.beam {
  stroke: color-mix(in srgb, var(--glow) 55%, white 15%);
  stroke-width: 1.4;
}

.flow {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.05 0.95;
  opacity: 0;
  animation: flow 2.4s linear infinite;
  filter: drop-shadow(0 0 4px var(--glow));
}

.orbit {
  fill: none;
  stroke: var(--line);
  stroke-dasharray: 2 7;
  transform-box: fill-box;
  transform-origin: center;
  animation: rot 90s linear infinite;
}

.orbit.b {
  animation-duration: 140s;
  animation-direction: reverse;
  stroke: rgba(170, 185, 255, 0.08);
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes flow {
  0% { stroke-dashoffset: 1; opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

/* every bubble: placed by the script */
.node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  will-change: transform;
  transition: transform 0.75s var(--spring), opacity 0.45s var(--ease), width 0.6s var(--spring), height 0.6s var(--spring), border-radius 0.6s var(--ease), background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.node.instant {
  transition: none !important;
}

/* the course colours */
.c-EXT1 { --c: var(--ext1); }
.c-ADVN { --c: var(--advn); }
.c-YR10 { --c: var(--yr10); }
.c-EXT2 { --c: var(--ext2); }
.c-STD2 { --c: var(--std2); }
.c-SCHOOL { --c: var(--school); }
.c-other { --c: var(--other); }

.course {
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--c) 55%, white 18%) 0, color-mix(in srgb, var(--c) 34%, transparent) 30%, color-mix(in srgb, var(--c) 10%, rgba(8, 10, 24, 0.6)) 72%);
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  box-shadow: 0 0 50px -6px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 24px rgba(255, 255, 255, 0.06), inset -10px -14px 30px rgba(0, 0, 0, 0.35);
}

.course .in {
  display: grid;
  gap: 1px;
  justify-items: center;
  transition: scale 0.4s var(--spring);
}

.course .cc {
  font: 600 calc(var(--d) * 0.17) / 1 var(--sans);
  letter-spacing: -0.02em;
  color: #fff;
}

.course .cn {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  white-space: nowrap;
}

.course .cm {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.course .in .dot,
.course .in .spinner {
  margin-top: 4px;
}

.course.big .in {
  animation: float var(--fd, 7s) ease-in-out infinite alternate;
}

.course.f1 { --fd: 7.3s; }
.course.f2 { --fd: 8.6s; }
.course.f3 { --fd: 9.9s; }
.course.f4 { --fd: 6.2s; }

.course.big:hover {
  box-shadow: 0 0 80px -4px color-mix(in srgb, var(--c) 75%, transparent), inset 0 0 24px rgba(255, 255, 255, 0.08), inset -10px -14px 30px rgba(0, 0, 0, 0.35);
}

.course.big:hover .in {
  scale: 1.05;
}

.course.sel::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  animation: halo 2.8s var(--ease) infinite;
}

.course.mini .cn,
.course.mini .cm,
.course.dock .cn,
.course.dock .cm,
.course.sel .cm,
.course.mini .in .dot,
.course.mini .in .spinner,
.course.dock .in .dot,
.course.dock .in .spinner {
  display: none;
}

.course.mini {
  opacity: 0.6;
}

.course.mini:hover {
  opacity: 1;
}

.course.mini .cc {
  font-size: 10px;
}

.course.dock .cc {
  font-size: 13px;
}

.narrow .course .cm {
  display: none;
}

@keyframes float {
  from { transform: translateY(-7px); }
  to { transform: translateY(7px); }
}

@keyframes halo {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* topics: pills, and the chosen one a bubble */
.topic {
  --c: var(--glow);
  height: var(--h);
  width: var(--w);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  text-align: left;
  white-space: nowrap;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topic:hover {
  background: var(--glass-2);
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--c) 60%, transparent);
}

.topic .tn {
  font: 500 11px var(--mono);
  color: var(--faint);
  min-width: 18px;
  text-align: right;
}

.topic .tt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic .tc {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.topic mark {
  background: none;
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--glow);
  text-underline-offset: 3px;
}

.topic .tsub {
  color: var(--faint);
  font-size: 12px;
}

.topic.orb {
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 12px;
  text-align: center;
  white-space: normal;
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--c) 40%, white 8%), color-mix(in srgb, var(--c) 14%, rgba(8, 10, 24, 0.7)) 70%);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 0 60px -8px color-mix(in srgb, var(--c) 60%, transparent);
}

.topic.orb .tn {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.topic.orb .tt {
  flex: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  text-wrap: balance;
  overflow: visible;
}

.topic.orb .tc {
  display: none;
}

/* the topic search */
.tsearch {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-50%) translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--spring), border-color 0.2s, box-shadow 0.3s;
}

.tsearch.on {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
  transition-delay: 0.25s, 0.25s, 0s, 0s;
}

.tsearch:focus-within {
  border-color: color-mix(in srgb, var(--glow) 60%, white 10%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 18%, transparent), 0 0 30px -8px var(--glow);
}

.tsearch input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: 400 14px var(--sans);
}

.tsearch input::placeholder {
  color: var(--faint);
}

.tsearch input::-webkit-search-cancel-button {
  display: none;
}

.tsearch kbd {
  font: 500 11px var(--mono);
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.tnone {
  position: absolute;
  z-index: 3;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* subtopics, each with its booklets */
.group {
  display: flex;
  align-items: center;
}

.gname {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px 0 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  width: var(--gw);
  min-width: 0;
}

.gname .gl {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 12px var(--mono);
  color: #fff;
  flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--glow) 60%, white 10%), color-mix(in srgb, var(--glow) 25%, transparent));
}

.gname .gt {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.gname .gnote {
  color: var(--faint);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gstem {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
  flex: none;
}

.gorbs {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.bk {
  position: relative;
  display: grid;
  justify-items: center;
  width: 64px;
  gap: 3px;
}

.fresh .bk {
  animation: pop 0.6s var(--spring) both;
  animation-delay: calc(var(--i) * 70ms + 380ms);
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.3) translateX(-24px); }
  to { opacity: 1; transform: none; }
}

.bk-orb {
  position: relative;
  width: 46px;
  height: 46px;
  display: block;
  margin-bottom: 3px;
}

.bk-open {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 12px var(--mono);
  color: #fff;
  text-decoration: none;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.28), rgba(160, 175, 255, 0.08) 55%, rgba(8, 10, 24, 0.6));
  border: 1px solid var(--line-2);
  transition: transform 0.35s var(--spring), box-shadow 0.3s, border-color 0.3s;
}

a.bk-open:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 24px -4px rgba(220, 228, 255, 0.45);
}

.bk-moon {
  position: absolute;
  z-index: 1;
  top: -6px;
  right: -8px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 9px var(--mono);
  color: var(--text-2);
  text-decoration: none;
  background: radial-gradient(circle at 35% 30%, #5a6084, #1c2036 75%);
  border: 1px solid rgba(170, 185, 255, 0.3);
  box-shadow: 0 0 0 2px var(--space), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--spring), color 0.2s;
}

.bk-moon:hover {
  transform: scale(1.25);
  color: #fff;
}

.bk-l {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.bk-w {
  font-size: 10px;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bk-w .dot {
  width: 5px;
  height: 5px;
}

.bk.s-failed .bk-w {
  color: var(--red);
}

.bk.s-compiling .bk-w {
  color: var(--text-2);
}

.bk.missing .bk-open {
  opacity: 0.5;
  border-style: dashed;
}

.bk-open.boom::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(230, 236, 255, 0.7);
  animation: boom 0.7s var(--ease) forwards;
}

@keyframes boom {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(2.4); opacity: 0; }
}

.narrow .group {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.narrow .gstem {
  display: none;
}

.narrow .gname {
  width: auto;
  max-width: calc(100vw - 156px);
}

.narrow .gorbs {
  padding-left: 4px;
  gap: 8px;
}

.narrow .bk-moon {
  width: 26px;
  height: 26px;
  top: -8px;
  right: -6px;
}

/* ---------- the server-made pages: one column of glass over the stars ---------- */

main.pubs,
main.history,
main.message,
main.signin {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding-block: 12px 96px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

main h1 {
  margin: 8px 0 20px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dim {
  color: var(--muted);
}

.strong {
  font-weight: 600;
}

.failed {
  color: var(--red);
}

.ghost-link {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
  font-size: 13px;
}

.ghost-link:hover {
  text-decoration-color: currentColor;
}

pre.msg {
  margin: 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: #ffd2d7;
  background: var(--red-pale);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius: 10px;
}

.stall {
  color: var(--red);
  font-size: 13px;
}

.swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.sw-EXT1 { background: var(--ext1); box-shadow: 0 0 8px var(--ext1); }
.sw-ADVN { background: var(--advn); box-shadow: 0 0 8px var(--advn); }
.sw-YR10 { background: var(--yr10); box-shadow: 0 0 8px var(--yr10); }
.sw-EXT2 { background: var(--ext2); box-shadow: 0 0 8px var(--ext2); }
.sw-STD2 { background: var(--std2); box-shadow: 0 0 8px var(--std2); }
.sw-SCHOOL { background: var(--school); box-shadow: 0 0 8px var(--school); }
.sw-other { background: var(--other); box-shadow: 0 0 8px var(--other); }

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--glass-2);
  border: 1px solid var(--line);
}

/* the Publishes page */
.pubs h2 {
  margin: 28px 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pb-quiet {
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 14px 18px;
}

.pb-live {
  border: 1px solid color-mix(in srgb, var(--live) 30%, var(--line));
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 60px -24px var(--live);
}

.pb-live-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pb-live-top .dim {
  font-size: 12px;
}

.pb-eta {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pb-bar {
  display: flex;
  gap: 4px;
  margin: 14px 0 12px;
}

.pb-seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.pb-seg.live {
  background: var(--live);
  box-shadow: 0 0 10px -2px var(--live);
}

.pb-seg.failed {
  background: var(--red);
}

.pb-seg.busy {
  background: linear-gradient(90deg, transparent, #fff, transparent) var(--line-2);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: sweep 1.3s linear infinite;
}

@keyframes sweep {
  from { background-position: -100% 0; }
  to { background-position: 200% 0; }
}

.pb-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.pb-step {
  display: grid;
  grid-template-columns: 16px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.pb-mark {
  display: grid;
  place-items: center;
}

.pb-type {
  font: 500 11px var(--mono);
  color: var(--muted);
}

.pb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-topic {
  color: var(--faint);
}

.pb-state {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pb-step.compiling .pb-state {
  color: var(--text-2);
}

.pb-step.failed .pb-state {
  color: var(--red);
}

.pb-fail {
  padding: 2px 0 8px 70px;
}

.pb-day {
  margin: 20px 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.pb-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pb-row {
  display: grid;
  grid-template-columns: 76px 150px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.pb-time {
  color: var(--text-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.pb-time:hover {
  text-decoration: underline;
}

.pb-by {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pb-by span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-what {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pb-course {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.pb-count {
  font-weight: 400;
  color: var(--faint);
  font-size: 12px;
}

.pb-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--text-2);
}

.pb-line a {
  text-decoration: none;
}

.pb-line a:hover {
  text-decoration: underline;
}

.chips {
  display: flex;
  gap: 4px;
}

.chip {
  font: 500 11px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px;
}

.chip.failed {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 50%, transparent);
}

.chip.dim {
  opacity: 0.6;
}

.pb-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}

.pb-more summary::-webkit-details-marker {
  display: none;
}

.pb-more[open] summary {
  margin-bottom: 4px;
}

.pb-paging {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

/* the sign-in page */
main.signin {
  max-width: 420px;
  min-height: calc(100% - 56px);
  display: grid;
  align-content: center;
  gap: 24px;
  text-align: center;
}

.signin-head h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.signin-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.signin-go {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--glow) 70%, white 10%), color-mix(in srgb, var(--glow) 40%, #0b0e1a));
  border: 1px solid color-mix(in srgb, var(--glow) 60%, transparent);
  box-shadow: 0 0 40px -10px var(--glow);
}

.signin-btn:hover {
  box-shadow: 0 0 60px -8px var(--glow);
}

.notice {
  display: flex;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
}

.notice div {
  display: grid;
  gap: 2px;
}

.notice div > span:first-child {
  font-weight: 500;
}

/* the message pages */
.message p {
  color: var(--text-2);
}

/* the release history */
.history .releases {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.history .releases li {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rel-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.releases .ver {
  font: 500 12px var(--mono);
}

.releases .state {
  color: var(--muted);
}

.releases .state.failed {
  color: var(--red);
}

.releases .when {
  color: var(--faint);
}

.btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--line-2);
}

.btn:hover {
  background: var(--glass-2);
}

/* ---------- phones ---------- */

@media (max-width: 720px) {
  header {
    gap: 10px;
  }

  .pb-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 12px;
  }

  .pb-what {
    grid-column: 1 / -1;
  }

  .pb-fail {
    padding-left: 0;
  }

  .crumbs button {
    min-height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .node {
    transition: opacity 0.2s !important;
  }

  .course.big .in,
  .course.sel::after,
  .orbit,
  .flow,
  .fresh .bk,
  .pb-seg.busy {
    animation: none !important;
  }

  .lk {
    animation: none;
    stroke-dashoffset: 0;
  }

  .spinner {
    animation-duration: 1.6s;
  }
}
