/* BlancBoard
   Ground rule for this design: the page is a board, and the only chromatic
   colour on it is other people. Cursors, name tags and avatars carry hue;
   every other element is ink on paper. */

:root {
  --board: #fcfcfd;
  --surface: #ffffff;
  --sunken: #f4f5f7;
  --rule: #e6e7eb;
  --dot: #dcdee4;
  --ink: #101114;
  --ink-2: #5a5d66;
  --ink-3: #8e9199;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, .06);
  --shadow-md: 0 8px 28px -12px rgba(16, 17, 20, .18);

  /* presence — the only hues in the system */
  --p1: #e5484d;
  --p2: #f76b15;
  --p3: #30a46c;
  --p4: #0091ff;
  --p5: #8e4ec6;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --gap: clamp(2.6rem, 5.5vw, 4.4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --board: #0c0d10;
    --surface: #16181d;
    --sunken: #1b1e24;
    --rule: #262931;
    --dot: #22252c;
    --ink: #eceef2;
    --ink-2: #9da1ab;
    --ink-3: #6c7078;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 8px 28px -12px rgba(0, 0, 0, .7);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--board);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -13px -13px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- type */

.eyebrow {
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

.display--xl { font-size: clamp(2.4rem, 6.4vw, 4.15rem); }
.display--l  { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.display--m  { font-size: clamp(1.45rem, 2.6vw, 1.8rem); }

.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.14rem);
  color: var(--ink-2);
  max-width: 34rem;
  margin: 0;
  text-wrap: pretty;
}

.prose { color: var(--ink-2); margin: 0; max-width: 34rem; text-wrap: pretty; }

a { color: inherit; }

.link {
  color: var(--ink);
  text-decoration-color: var(--ink-3);
  text-underline-offset: 3px;
}
.link:hover { text-decoration-color: var(--ink); }

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

/* ---------------------------------------------------------------- layout */

.shell {
  /* width:100% matters inside .centered, which is a flex column: there a bare
     `margin: 0 auto` makes the item shrink to its content instead of
     stretching, and the masthead collapses to the middle of the page. */
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.stack { display: flex; flex-direction: column; }
.stack--xs { gap: .6rem; }
.stack--sm { gap: 1rem; }
.stack--md { gap: 1.6rem; }
.stack--lg { gap: 2.4rem; }

.band { padding-block: var(--gap); }
.band--tight { padding-block: calc(var(--gap) * .58); }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark__mark {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  position: relative;
  flex: none;
}
.wordmark__mark::after {
  content: "";
  position: absolute;
  inset: 3px 3px auto auto;
  width: 5px;
  height: 5px;
  background: var(--ink);
  border-radius: 1px;
}

.masthead__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.masthead__link {
  font-size: .9rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: 6px;
}
.masthead__link:hover { color: var(--ink); background: var(--sunken); }

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

.btn {
  font-family: inherit;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1;
  padding: .72rem 1.15rem;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background-color .14s ease, border-color .14s ease, transform .14s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn[disabled]:active { transform: none; }

.btn--primary { background: var(--ink); color: var(--board); }
.btn--primary:hover:not([disabled]) { background: var(--ink-2); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover:not([disabled]) { border-color: var(--ink-3); background: var(--surface); }

.btn--wide { width: 100%; }

/* ---------------------------------------------------------------- board + presence */

.board {
  position: relative;
  isolation: isolate;
}

.presence {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  gap: 3px;
  will-change: transform;
}

.cursor__arrow { width: 15px; height: 18px; flex: none; display: block; }

.cursor__tag {
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .04em;
  color: #fff;
  padding: .16rem .38rem;
  border-radius: 3px;
  white-space: nowrap;
  transform: translateY(11px);
}

/* Own padding rather than .band: the hero carries the presence layer and needs
   a tighter top and a looser bottom than a normal section. */
.hero {
  position: relative;
  z-index: 2;
  padding-block: clamp(1.25rem, 3vw, 2.25rem) clamp(2.5rem, 5vw, 3.75rem);
}

/* Clearance for the selection tag, which hangs above the frame. */
.hero__object { padding-top: 1rem; }

/* The headline is rendered the way a selected object looks on a canvas:
   a hairline frame, four corner handles and the tag of whoever holds it. */
.selected { position: relative; display: inline-block; padding: .35rem .6rem; margin: -.35rem -.6rem; }

.selected__frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--p4);
  border-radius: 2px;
  pointer-events: none;
}

.selected__handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--surface);
  border: 1px solid var(--p4);
  border-radius: 1px;
}
.selected__handle--tl { top: -4px; left: -4px; }
.selected__handle--tr { top: -4px; right: -4px; }
.selected__handle--bl { bottom: -4px; left: -4px; }
.selected__handle--br { bottom: -4px; right: -4px; }

.selected__tag {
  position: absolute;
  top: -1.35rem;
  left: -1px;
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .04em;
  color: #fff;
  background: var(--p4);
  padding: .16rem .38rem;
  border-radius: 3px;
  white-space: nowrap;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.hero__note {
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: .04em;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- roster */

.roster { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

.roster__stack { display: flex; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--board);
  margin-left: -7px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: .62rem;
  color: #fff;
  flex: none;
}
.avatar:first-child { margin-left: 0; }

.roster__label { font-family: var(--mono); font-size: .69rem; letter-spacing: .04em; color: var(--ink-3); }

/* ---------------------------------------------------------------- notes */

.notes {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.note { background: var(--surface); padding: 1.5rem 1.4rem 1.7rem; display: flex; flex-direction: column; gap: .55rem; }
.note__label { font-family: var(--mono); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); }
.note__title { font-family: var(--serif); font-size: 1.18rem; font-weight: 400; margin: 0; letter-spacing: -.01em; }
.note__body { color: var(--ink-2); font-size: .94rem; margin: 0; }

/* ---------------------------------------------------------------- panel (auth) */

.centered { min-height: 100vh; display: flex; flex-direction: column; }
.centered__body { flex: 1; display: flex; align-items: center; justify-content: center; padding-block: 3rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: clamp(1.6rem, 4vw, 2.3rem);
  width: 100%;
  max-width: 25rem;
}

.field { display: flex; flex-direction: column; gap: .4rem; }

.field__label { font-family: var(--mono); font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }

.input {
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--board);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: .68rem .8rem;
  width: 100%;
  transition: border-color .14s ease;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sunken); }
.input--code { font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; }

.msg {
  font-size: .87rem;
  border-radius: 7px;
  padding: .65rem .8rem;
  display: none;
  border: 1px solid transparent;
  line-height: 1.5;
}
.msg[data-state="error"] { display: block; color: var(--p1); border-color: color-mix(in srgb, var(--p1) 30%, transparent); background: color-mix(in srgb, var(--p1) 7%, transparent); }
.msg[data-state="ok"]    { display: block; color: var(--p3); border-color: color-mix(in srgb, var(--p3) 30%, transparent); background: color-mix(in srgb, var(--p3) 8%, transparent); }
.msg[data-state="info"]  { display: block; color: var(--ink-2); border-color: var(--rule); background: var(--sunken); }

.panel__foot { font-size: .87rem; color: var(--ink-2); text-align: center; }

/* ---------------------------------------------------------------- changelog */

.entry { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.4rem; align-items: baseline; }
.entry__meta { font-family: var(--mono); font-size: .69rem; letter-spacing: .05em; color: var(--ink-3); }
.entry__list { margin: 0; padding-left: 1.05rem; color: var(--ink-2); display: flex; flex-direction: column; gap: .35rem; }
.entry__list li::marker { color: var(--ink-3); }

@media (max-width: 34rem) {
  .entry { grid-template-columns: 1fr; gap: .5rem; }
}

/* ---------------------------------------------------------------- footer */

.footer {
  padding-block: 2.2rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  align-items: center;
  font-family: var(--mono);
  font-size: .69rem;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.footer a { color: var(--ink-3); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer__spacer { margin-left: auto; }

/* ---------------------------------------------------------------- motion */

.rise { opacity: 0; transform: translateY(9px); animation: rise .62s cubic-bezier(.2, .7, .3, 1) forwards; }
.rise--1 { animation-delay: .04s; }
.rise--2 { animation-delay: .12s; }
.rise--3 { animation-delay: .2s; }
.rise--4 { animation-delay: .28s; }

@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; transform: none; }
  .btn { transition: none; }
  .btn:active { transform: none; }
}

/* ---------------------------------------------------------------- photo band

   One photograph on the whole site, desaturated on purpose: the physical board
   is the grey ancestor, and colour is reserved for people who are present. */

.photoband {
  position: relative;
  margin-block: var(--gap);
  border-block: 1px solid var(--rule);
  background: var(--sunken);
  min-height: 24rem;
  display: grid;
  align-items: center;
  isolation: isolate;
}

.photoband__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  z-index: -1;
  opacity: .9;
}

@media (prefers-color-scheme: dark) {
  /* The photograph is high-key, so even a low opacity lifts the band well
     above the rest of a dark page. Keep it close to the page ground. */
  .photoband__img { opacity: .15; }
}

/* The eyebrow's usual tertiary ink disappears against the photograph in both
   themes; on this band it steps up one level. */
.photoband__copy .eyebrow { color: var(--ink-2); }

/* The photograph's left third is out-of-focus and nearly empty; the copy sits
   there, so no scrim is needed over the part that carries detail. */
.photoband__copy { padding-block: clamp(2.6rem, 7vw, 4.5rem); }
.photoband__copy .stack { max-width: 30rem; }

/* ---------------------------------------------------------------- access */

.access {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 52rem) {
  .access { grid-template-columns: 1fr; }
}

.code-hint {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .05em .35em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- narrow

   On a phone the board has no spare width: the "right half" the cursors drift
   through is the text column, so presence is dropped rather than allowed to
   collide with the headline. The board still reads as a board through the dot
   grid and the selection frame. */

@media (max-width: 48rem) {
  .presence { display: none; }

  /* The photograph's detail sits right of centre; on narrow screens the copy
     would land on top of it, so pan to the out-of-focus left instead. */
  .photoband__img { object-position: 18% 50%; }
}

@media (max-width: 30rem) {
  /* Changelog also lives in the footer, so it is the link to lose first when
     the masthead runs out of room. */
  .masthead__nav .masthead__link[href="/changelog"] { display: none; }
  .masthead { gap: .75rem; }
  .masthead__nav { gap: .15rem; }
  .masthead__link { padding-inline: .45rem; }
  .btn { padding-inline: .85rem; }
  .hero__actions .btn { flex: 1 1 auto; }
}
