/* The supporter forum, inside the account world. The board walks one state
   at a time; the current state's rule fills with ink, the way a wall turn does. */

.forum-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(24 * var(--u));
}
.forum-head .button {
  flex: none;
  margin-top: 0;
}

.forum-turns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(16 * var(--u));
  margin-top: calc(48 * var(--u));
}
.forum-turn {
  display: grid;
  align-content: start;
  gap: calc(10 * var(--u));
  min-height: calc(44 * var(--u));
  color: var(--muted);
  font-size: calc(13 * var(--u));
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.forum-turn:hover,
.forum-turn[aria-current="true"] {
  color: var(--ink);
}
.forum-turn .turn-bar {
  position: relative;
  display: block;
  height: 2px;
  background: var(--line);
}
.forum-turn:hover .turn-bar {
  background: #b7c3c9;
}
.forum-turn .turn-bar > span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}
.forum-turn[aria-current="true"] .turn-bar > span {
  animation: forum-fill 720ms var(--ease) forwards;
}
@keyframes forum-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.forum-count {
  min-height: calc(21 * var(--u));
  margin: calc(18 * var(--u)) 0 0;
  color: var(--muted);
  font-size: calc(13 * var(--u));
  font-variant-numeric: tabular-nums;
}
.forum-count:empty {
  display: none;
}

.forum-list {
  margin-top: calc(12 * var(--u));
  border-top: 1px solid var(--line);
}
.forum-list:empty {
  border-top: 0;
}
.forum-row {
  display: grid;
  grid-template-columns: calc(56 * var(--u)) minmax(0, 1fr) auto auto auto;
  column-gap: calc(18 * var(--u));
  align-items: center;
  min-height: calc(72 * var(--u));
  padding-block: calc(12 * var(--u));
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.forum-row:hover .forum-row-title {
  color: var(--accent);
}
.forum-number,
.forum-row .forum-comments {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: calc(13 * var(--u));
}
.forum-row-title {
  overflow: hidden;
  font-size: calc(15 * var(--u));
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-kind {
  color: var(--muted);
  font-size: calc(13 * var(--u));
  white-space: nowrap;
}
.forum-author {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  min-width: 0;
}
.forum-row .portrait,
.forum-meta .portrait,
.forum-comment .portrait {
  --size: calc(36 * var(--u));
}
.forum-name {
  overflow: hidden;
  font-size: calc(14 * var(--u));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-role {
  color: var(--muted);
  font-size: calc(12 * var(--u));
  font-weight: 400;
}
.forum-row .forum-comments {
  justify-self: end;
}

.forum-issue,
.forum-new {
  max-width: 72ch;
}
.forum-back {
  color: var(--muted);
  font-size: calc(13 * var(--u));
  font-weight: 600;
  text-decoration: none;
}
.forum-back:hover {
  color: var(--accent);
}
.forum-title {
  margin: calc(16 * var(--u)) 0 0;
  font-family: var(--display);
  font-size: clamp(32 * var(--u), 3vw, 48 * var(--u));
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.forum-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(8 * var(--u)) calc(10 * var(--u));
  margin-top: calc(18 * var(--u));
  color: var(--muted);
  font-size: calc(14 * var(--u));
}
.forum-meta .forum-name {
  color: var(--ink);
}
.forum-dot {
  color: var(--soft);
}
.forum-body,
.forum-comment-body {
  max-width: 68ch;
  margin: calc(28 * var(--u)) 0 0;
  font-size: calc(15 * var(--u));
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.forum-label-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(4 * var(--u)) calc(18 * var(--u));
  margin-top: calc(32 * var(--u));
  padding-top: calc(20 * var(--u));
  border-top: 1px solid var(--line);
}
.forum-label-name {
  font-size: calc(13 * var(--u));
  font-weight: 600;
}
.forum-label-form .button {
  margin-top: 0;
}
.forum-saved:empty {
  display: none;
}
.forum-saved {
  color: var(--muted);
  font-size: calc(13 * var(--u));
}
.forum-thread {
  width: 100%;
  margin: calc(40 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  justify-self: stretch;
}
.forum-comment {
  padding: calc(22 * var(--u)) 0;
  border-bottom: 1px solid var(--line);
}
.forum-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(8 * var(--u)) calc(16 * var(--u));
}
.forum-comment-head time {
  color: var(--muted);
  font-size: calc(13 * var(--u));
  font-variant-numeric: tabular-nums;
}
.forum-comment-body {
  margin-top: calc(12 * var(--u));
}
.forum-reply {
  display: grid;
  gap: calc(16 * var(--u));
  margin-top: calc(28 * var(--u));
}
.forum-reply .button,
.forum-actions .button {
  margin-top: 0;
}
.forum-actions {
  margin-top: calc(8 * var(--u));
}
.field textarea {
  width: 100%;
  min-height: calc(160 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border: 1px solid var(--control-border);
  border-radius: calc(12 * var(--u));
  background: var(--paper);
  color: var(--ink);
  font: 400 calc(15 * var(--u)) / 1.6 var(--body);
  resize: vertical;
}
.field textarea:hover {
  border-color: var(--rule-strong);
}
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(55 88 101 / 0.22);
}
.forum-choices {
  display: grid;
  gap: calc(4 * var(--u));
  margin: 0;
  padding: 0;
  border: 0;
}
.forum-choices legend {
  margin-bottom: calc(6 * var(--u));
  font-size: calc(13 * var(--u));
  font-weight: 600;
}
.forum-choice {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: calc(44 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 600;
}
.forum-choice input {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  margin: 0;
}
.forum-new {
  display: grid;
  gap: calc(22 * var(--u));
}
.forum-new .account-title,
.forum-new .account-lead,
.forum-new .button {
  margin-top: 0;
  margin-bottom: 0;
}
/* The gate, signed in without a purchase: what the edition brings, the account
   it is about, then a hairline index of where each way out leads. */
.gate-perks {
  display: flex;
  flex-wrap: wrap;
  gap: calc(10 * var(--u)) calc(24 * var(--u));
  margin: calc(20 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: calc(14 * var(--u));
  font-weight: 600;
}
.gate-perks li {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
}
.gate-perks svg,
.gate-path-icon svg {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gate-perks svg {
  color: var(--muted);
}
.gate-account {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  margin-top: calc(40 * var(--u));
}
.gate-account .portrait {
  --size: calc(40 * var(--u));
  flex: none;
}
.gate-account p {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}
.gate-account strong {
  color: var(--ink);
  font-size: calc(15 * var(--u));
  font-weight: 600;
  overflow-wrap: anywhere;
}
.gate-account-state {
  color: var(--muted);
  font-size: calc(13 * var(--u));
}
.gate-paths {
  max-width: calc(720 * var(--u));
  margin-top: calc(20 * var(--u));
  border-top: 1px solid var(--line);
}
.gate-path {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: calc(16 * var(--u));
  row-gap: calc(2 * var(--u));
  align-items: center;
  padding-block: calc(18 * var(--u));
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
/* The glyph key, set as the header's keys are: ink at 6% on 14px corners. */
.gate-path-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: calc(48 * var(--u));
  height: calc(48 * var(--u));
  border-radius: calc(14 * var(--u));
  background: rgb(24 33 38 / 0.06);
  color: var(--ink);
  transition:
    background-color 160ms ease,
    color 160ms ease;
}
.gate-path-title {
  grid-column: 2;
  align-self: end;
  font-family: var(--display);
  font-size: calc(22 * var(--u));
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: color 160ms ease;
}
.gate-path-note {
  grid-column: 2;
  align-self: start;
  color: var(--muted);
  font-size: calc(14 * var(--u));
  line-height: 1.5;
}
/* The way on: an ink disc for the main path, a quiet ink-at-6% one for the
   other. Two arrows sit in the same cell; the second waits off to the left. */
.gate-path-arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  overflow: hidden;
  border-radius: 50%;
  background: rgb(24 33 38 / 0.06);
  color: var(--ink);
  transition: background-color 160ms ease;
}
.gate-path-main .gate-path-arrow {
  background: var(--ink);
  color: #fff;
}
.gate-path-arrow svg {
  grid-area: 1 / 1;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gate-path-arrow svg + svg {
  opacity: 0;
}
.gate-path:hover .gate-path-title {
  color: var(--accent);
}
.gate-path:hover .gate-path-icon {
  background: var(--tint);
  color: var(--accent);
}
.gate-path:hover .gate-path-arrow {
  background: var(--tint);
  color: var(--accent);
}
.gate-path-main:hover .gate-path-arrow {
  background: var(--accent);
  color: #fff;
}
.gate-path:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .gate-path-arrow {
    transition:
      background-color 160ms ease,
      transform 160ms var(--ease);
  }
  .gate-path-arrow svg {
    transition:
      transform 420ms var(--ease),
      opacity 200ms ease;
  }
  .gate-path-arrow svg + svg {
    opacity: 1;
    transform: translateX(-200%);
  }
  .gate-path:hover .gate-path-arrow svg:first-child {
    opacity: 0;
    transform: translateX(200%);
  }
  .gate-path:hover .gate-path-arrow svg + svg {
    transform: none;
  }
  .gate-path:active .gate-path-arrow {
    transform: scale(0.94);
  }
  /* The heart beats once when its path is pointed at. */
  .gate-path-main:hover .gate-path-icon svg {
    animation: gate-beat 560ms var(--ease);
  }
}
@keyframes gate-beat {
  30% {
    transform: scale(1.16);
  }
  55% {
    transform: scale(0.96);
  }
}

/* Loading. The outline of a page head, then of a list's rows, pulsing slowly
   where the words will land; it appears only if the wait is noticeable. */
.forum-loading {
  display: grid;
  justify-items: start;
  font-size: clamp(40 * var(--u), 4.5vw, 64 * var(--u));
}
.forum-loading span,
.forum-ghost span {
  display: block;
  border-radius: calc(8 * var(--u));
  background: var(--tint);
}
.forum-loading span {
  height: 0.8em;
  margin-block: 0.13em;
}
.forum-loading span:nth-child(1) {
  width: 3.8em;
}
.forum-loading span:nth-child(2) {
  width: 6.6em;
  max-width: 100%;
}
.forum-loading span:nth-child(3),
.forum-loading span:nth-child(4) {
  height: calc(16 * var(--u));
  margin-block: 0;
}
.forum-loading span:nth-child(3) {
  width: min(100%, 520 * var(--u));
  margin-top: calc(32 * var(--u));
}
.forum-loading span:nth-child(4) {
  width: min(70%, 320 * var(--u));
  margin-top: calc(14 * var(--u));
}
.forum-ghost {
  display: grid;
  grid-template-columns: calc(36 * var(--u)) minmax(0, 1fr);
  gap: calc(8 * var(--u)) calc(16 * var(--u));
  align-items: center;
  padding-block: calc(20 * var(--u));
  border-bottom: 1px solid var(--line);
}
.forum-ghost span:nth-child(1) {
  grid-row: 1 / span 2;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
}
.forum-ghost span:nth-child(2) {
  width: min(100%, 360 * var(--u));
  height: calc(14 * var(--u));
}
.forum-ghost span:nth-child(3) {
  width: min(60%, 160 * var(--u));
  height: calc(12 * var(--u));
}
.forum-ghost:nth-child(2) span:nth-child(2) {
  width: min(80%, 280 * var(--u));
}
@media (prefers-reduced-motion: no-preference) {
  .forum-loading,
  .forum-ghost {
    animation: forum-wait 320ms ease 180ms both;
  }
  .forum-loading span,
  .forum-ghost span {
    animation: pending 1.1s ease-in-out infinite alternate;
  }
  .forum-loading span:nth-child(2),
  .forum-ghost:nth-child(2) span {
    animation-delay: 140ms;
  }
  .forum-loading span:nth-child(3),
  .forum-ghost:nth-child(3) span {
    animation-delay: 280ms;
  }
  .forum-loading span:nth-child(4) {
    animation-delay: 420ms;
  }

  /* What arrives rises into place, a beat apart. */
  .forum-gate > :not(.gate-paths),
  .gate-path,
  [data-forum-app] > :not(.forum-list),
  .forum-row,
  .forum-person,
  [data-forum-issue] {
    animation: arrive 640ms var(--ease) both;
  }
  .forum-gate > :nth-child(2),
  [data-forum-app] > :nth-child(2),
  .forum-row:nth-child(2),
  .forum-person:nth-child(2) {
    animation-delay: 60ms;
  }
  .forum-gate > :nth-child(3),
  [data-forum-app] > :nth-child(3),
  .forum-row:nth-child(3),
  .forum-person:nth-child(3) {
    animation-delay: 120ms;
  }
  .forum-gate > :nth-child(4),
  .gate-path:nth-child(1),
  [data-forum-app] > :nth-child(4),
  .forum-row:nth-child(n + 4),
  .forum-person:nth-child(n + 4) {
    animation-delay: 180ms;
  }
  .gate-path:nth-child(2) {
    animation-delay: 240ms;
  }
}
@keyframes forum-wait {
  from {
    opacity: 0;
  }
}
@keyframes pending {
  to {
    opacity: 0.45;
  }
}
.forum-empty {
  margin: calc(8 * var(--u)) 0 0;
  color: var(--muted);
  font-size: calc(15 * var(--u));
  line-height: 1.6;
}
.forum-staff {
  display: inline-block;
  margin-top: calc(12 * var(--u));
  color: var(--muted);
  font-size: calc(13 * var(--u));
  font-weight: 600;
  text-decoration: none;
}
.forum-staff:hover {
  color: var(--accent);
}
.forum-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: calc(8 * var(--u)) calc(24 * var(--u));
  align-items: center;
  padding-block: calc(16 * var(--u));
  border-bottom: 1px solid var(--line);
}
.forum-person-name {
  margin: 0;
  font-size: calc(15 * var(--u));
  font-weight: 600;
}
.forum-person-meta {
  margin: calc(4 * var(--u)) 0 0;
  color: var(--muted);
  font-size: calc(13 * var(--u));
  overflow-wrap: anywhere;
}
.forum-person-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: calc(8 * var(--u));
}
.forum-person-actions .button {
  margin-top: 0;
}

@media (max-width: 720px) {
  .forum-head {
    flex-direction: column;
    align-items: stretch;
  }
  .forum-row {
    grid-template-columns: calc(48 * var(--u)) minmax(0, 1fr) auto;
    grid-template-areas:
      "num title comments"
      "num kind comments"
      "num author comments";
    row-gap: calc(2 * var(--u));
    padding-block: calc(16 * var(--u));
  }
  .forum-number {
    grid-area: num;
    align-self: start;
    padding-top: calc(2 * var(--u));
  }
  .forum-row-title {
    grid-area: title;
  }
  .forum-kind {
    grid-area: kind;
  }
  .forum-author {
    grid-area: author;
  }
  .forum-row .forum-comments {
    grid-area: comments;
    align-self: start;
  }
  .forum-person {
    grid-template-columns: 1fr;
  }
  .forum-person-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .forum-turn[aria-current="true"] .turn-bar > span {
    animation: none;
    transform: scaleX(1);
  }
}

@media (forced-colors: active) {
  .forum-turn[aria-current="true"] .turn-bar > span {
    background: CanvasText;
  }
  .forum-row {
    border-bottom-color: CanvasText;
  }
  .forum-loading span,
  .forum-ghost span {
    forced-color-adjust: none;
    background: GrayText;
  }
}
